From 9ba010ea23d57d9e5f1aa0daf3f42ee2824c356a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 15 Mar 2010 16:26:38 +0000 Subject: [PATCH] Monotone-Parent: 1afacdb0dfec56c8c5b9390da0be478613fe1c96 Monotone-Revision: ff41de0005ad37b6858452da3e9c6d0cf21078af Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-03-15T16:26:38 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/UIxCalListingActions.m | 33 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb9909e3d..1185946f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-03-15 Wolfgang Sourdeau + * UI/Scheduler/UIxCalListingActions.m (_fixDates:): the events + appearing in the month view needs to have their dates fixed too. + Also, the algorithm was lightly simplified. + * SoObjects/Appointments/SOGoAppointmentFolder.m (-initWithName:inContainer:): "davTimeLimitSeconds" and "davTimeHalfLimitSeconds" were erroneously reverted to 0 after diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index f5de5ffeb..6d79992ac 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -266,27 +266,26 @@ static NSArray *tasksFields = nil; NSCalendarDate *aDate, *aStartDate; NSNumber *aDateValue; NSString *aDateField; - signed int daylightOffset; + int daylightOffset; unsigned int count; static NSString *fields[] = { @"startDate", @"c_startdate", @"endDate", @"c_enddate" }; - if (dayBasedView) - for (count = 0; count < 2; count++) - { - aDateField = fields[count * 2]; - aDate = [aRecord objectForKey: aDateField]; - if ([userTimeZone isDaylightSavingTimeForDate: aDate] != - [userTimeZone isDaylightSavingTimeForDate: startDate]) - { - daylightOffset = (signed int)[userTimeZone secondsFromGMTForDate: aDate] - - (signed int)[userTimeZone secondsFromGMTForDate: startDate]; - aDate = [aDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:daylightOffset]; - [aRecord setObject: aDate forKey: aDateField]; - aDateValue = [NSNumber numberWithInt: [aDate timeIntervalSince1970]]; - [aRecord setObject: aDateValue forKey: fields[count * 2 + 1]]; - } - } + for (count = 0; count < 2; count++) + { + aDateField = fields[count * 2]; + aDate = [aRecord objectForKey: aDateField]; + daylightOffset = (int) ([userTimeZone secondsFromGMTForDate: aDate] + - [userTimeZone secondsFromGMTForDate: startDate]); + if (daylightOffset) + { + aDate = [aDate dateByAddingYears: 0 months: 0 days: 0 hours: 0 + minutes: 0 seconds: daylightOffset]; + [aRecord setObject: aDate forKey: aDateField]; + aDateValue = [NSNumber numberWithInt: [aDate timeIntervalSince1970]]; + [aRecord setObject: aDateValue forKey: fields[count * 2 + 1]]; + } + } aDateValue = [aRecord objectForKey: @"c_recurrence_id"]; aDate = [aRecord objectForKey: @"cycleStartDate"];