diff --git a/ChangeLog b/ChangeLog index 4839c684e..9c0e04263 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-02-14 Francis Lachapelle + + * UI/Scheduler/UIxDatePicker.m + (-takeValuesFromRequest:inContext:): we now consider the timezone + offset with respect to the current date, ie we properly consider daylight + saving time offset. + 2011-02-14 Wolfgang Sourdeau * OpenChange/MAPIStoreMailMessageTable.m (-restrictedChildKeys): diff --git a/UI/Scheduler/UIxDatePicker.m b/UI/Scheduler/UIxDatePicker.m index 173d388fd..f0618a744 100644 --- a/UI/Scheduler/UIxDatePicker.m +++ b/UI/Scheduler/UIxDatePicker.m @@ -149,7 +149,7 @@ NSString *dateString; NSCalendarDate *d; NSInteger dateTZOffset, userTZOffset; - NSTimeZone *userTZ; + NSTimeZone *systemTZ, *userTZ; SOGoUserDefaults *ud; dateString = [_rq formValueForKey:[self dateID]]; @@ -168,9 +168,10 @@ /* we must adjust the date timezone because "dateWithString:..." uses the system timezone, which can be different from the user's. */ ud = [[_ctx activeUser] userDefaults]; - dateTZOffset = [[d timeZone] secondsFromGMT]; + systemTZ = [d timeZone]; + dateTZOffset = [systemTZ secondsFromGMTForDate: d]; userTZ = [ud timeZone]; - userTZOffset = [userTZ secondsFromGMT]; + userTZOffset = [userTZ secondsFromGMTForDate: d]; if (dateTZOffset != userTZOffset) d = [d dateByAddingYears: 0 months: 0 days: 0 hours: 0 minutes: 0