iCalDateTIme: fix all-day entities

When setting an all-day entity (no time), make sure to set the
NSCalendarDate to GMT before formatting the string.
pull/8/head
Francis Lachapelle 2013-01-21 13:40:11 -05:00
parent 5c3dc34440
commit d835921062
1 changed files with 4 additions and 6 deletions

View File

@ -122,15 +122,13 @@
else
{
tmpTime = [dateTime copy];
utcTZ = [NSTimeZone timeZoneWithName: @"GMT"];
[tmpTime setTimeZone: utcTZ];
if (forAllDayEntity)
timeString = [tmpTime iCalFormattedDateString];
else
{
utcTZ = [NSTimeZone timeZoneWithName: @"GMT"];
[tmpTime setTimeZone: utcTZ];
timeString = [NSString stringWithFormat: @"%@Z",
[tmpTime iCalFormattedDateTimeString]];
}
timeString = [NSString stringWithFormat: @"%@Z",
[tmpTime iCalFormattedDateTimeString]];
[tmpTime release];
}
}