From d835921062e71b96410b74c35df8e089493bbbde Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 21 Jan 2013 13:40:11 -0500 Subject: [PATCH] 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. --- SOPE/NGCards/iCalDateTime.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SOPE/NGCards/iCalDateTime.m b/SOPE/NGCards/iCalDateTime.m index 81d0a88aa..74e89228e 100644 --- a/SOPE/NGCards/iCalDateTime.m +++ b/SOPE/NGCards/iCalDateTime.m @@ -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]; } }