From 9ce08f0f998cb2ec7f8823c4b52828908f2a1a8a Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 14 Feb 2011 18:02:39 +0000 Subject: [PATCH] See Changelog. Monotone-Parent: 5f859ec68ac3088a6a1a60e1cf887c3208974571 Monotone-Revision: 2ec967e2199c437328dde8da267393b6e0d4722b Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-02-14T18:02:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ UI/Scheduler/UIxDatePicker.m | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) 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