diff --git a/ChangeLog b/ChangeLog index d87116f9d..7ad9bda67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,9 +8,17 @@ (-takeValuesFromRequest:inContext:): we no longer associate a vTimeZone to start/end dates of an all-day vEvent. -2011-03-17 Francis Lachapelle + * UI/Scheduler/UIxCalListingActions.m + (-_fetchFields:forComponentOfType:): we don't add components + outside the covered period. This could happen with all-day events, + since their dates are always GMT. - * SoObjects/Appointments/iCalEvent+SOGo.m (-quickRecord): + * SoObjects/Appointments/iCalEvent+SOGo.m (-quickRecord): an all-day + event usually doesn't have a timezone. However, if it does, we must + convert its dates to GMT. All-day events are "floating", in the + sense that are timezone-independant. + +2011-03-17 Francis Lachapelle * UI/MailerUI/UIxMailAccountActions.m (-listMailboxesAction): moved code that fetches the inbox quota to [SOGoMailAccount getInboxQuota]. diff --git a/SoObjects/Appointments/iCalEvent+SOGo.m b/SoObjects/Appointments/iCalEvent+SOGo.m index 2fc7a2021..3084aca36 100644 --- a/SoObjects/Appointments/iCalEvent+SOGo.m +++ b/SoObjects/Appointments/iCalEvent+SOGo.m @@ -32,6 +32,7 @@ #import #import +#import #import #import #import @@ -74,6 +75,8 @@ unsigned int i, count, boolTmp; BOOL isAllDay; iCalAccessClass accessClass; + iCalDateTime *date; + iCalTimeZone *timeZone; /* extract values */ @@ -124,18 +127,36 @@ if ([startDate isNotNull]) { -// if (isAllDay) -// NSLog (@"start date..."); + if (isAllDay) + { + // An all-day event usually doesn't have a timezone associated to its + // start date; however, if it does, we convert it to GMT. + date = (iCalDateTime*) [self uniqueChildWithTag: @"dtstart"]; + timeZone = [(iCalDateTime*) date timeZone]; + if (timeZone) + startDate = [timeZone computedDateForDate: startDate]; + } [row setObject: [self quickRecordDateAsNumber: startDate - withOffset: 0 forAllDay: isAllDay] - forKey: @"c_startdate"]; + withOffset: 0 + forAllDay: isAllDay] + forKey: @"c_startdate"]; } if ([endDate isNotNull]) - [row setObject: [self quickRecordDateAsNumber: endDate - withOffset: ((isAllDay) ? -1 : 0) - forAllDay: isAllDay] - forKey: @"c_enddate"]; - + { + if (isAllDay) + { + // An all-day event usually doesn't have a timezone associated to its + // end date; however, if it does, we convert it to GMT. + date = (iCalDateTime*) [self uniqueChildWithTag: @"dtend"]; + timeZone = [(iCalDateTime*) date timeZone]; + if (timeZone) + endDate = [timeZone computedDateForDate: endDate]; + } + [row setObject: [self quickRecordDateAsNumber: endDate + withOffset: ((isAllDay) ? -1 : 0) + forAllDay: isAllDay] + forKey: @"c_enddate"]; + } if ([self isRecurrent]) { NSCalendarDate *date;