From d2ca80f4b4fc8e1608def67babf41058a73efabf Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 21 May 2010 21:30:33 +0000 Subject: [PATCH] Monotone-Parent: 164d0ac238e069b138546ff280879bd831709536 Monotone-Revision: 7bb42646015cb99b0c6dfe942e088aba59cc5991 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-05-21T21:30:33 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/Appointments/SOGoAptMailUpdate.m | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ed35e0ba..3a349ebdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-05-21 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAptMailUpdate.m (-valueForProperty:): + set the timezone of date objects to the active user's timezone. + * UI/WebServerResources/SchedulerUI.js: (resetCategoriesStyles): fixed an exception occurring when UserDefaults['SOGoCalendarCategoriesColors'] is undefined. diff --git a/SoObjects/Appointments/SOGoAptMailUpdate.m b/SoObjects/Appointments/SOGoAptMailUpdate.m index 4fa3eb5d5..90ed63705 100644 --- a/SoObjects/Appointments/SOGoAptMailUpdate.m +++ b/SoObjects/Appointments/SOGoAptMailUpdate.m @@ -19,6 +19,8 @@ 02111-1307, USA. */ +#import + #import #import #import @@ -27,6 +29,7 @@ #import #import #import +#import #import "SOGoAptMailNotification.h" @@ -38,9 +41,10 @@ - (NSString *) valueForProperty: (NSString *) property { static NSDictionary *valueTypes = nil; - SOGoDateFormatter *dateFormatter; NSString *valueType; id value; + SOGoUser *user; + NSTimeZone *userTZ; if (!valueTypes) { @@ -61,9 +65,11 @@ value = [(iCalEvent *) apt propertyValue: property]; if ([valueType isEqualToString: @"date"]) { - dateFormatter = [[context activeUser] - dateFormatterInContext: context]; - value = [dateFormatter formattedDateAndTime: value]; + user = [context activeUser]; + userTZ = [[user userDefaults] timeZone]; + [value setTimeZone: userTZ]; + value = [[user dateFormatterInContext: context] + formattedDateAndTime: value]; } } else