From 5396c23a62f52656c3784e80654a59ac7223d2c1 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 14 Oct 2009 19:27:45 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: cff51eb80ef633a72d1cc7527a1092b597f57f55 Monotone-Revision: 2b398c7917c2665525f315c4a078f13665aeea62 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-10-14T19:27:45 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Scheduler/UIxCalListingActions.m | 34 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19e027138..86dd66f70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-10-14 Francis Lachapelle + * UI/Scheduler/UIxCalListingActions.m (_fixDates:): start/end + dates must be adjust for DST only when dealing with the day based + view. No change is required for the month view, except for the + recurrence IDs. + * UI/Scheduler/UIxComponentEditor.m (-getEventRWType): the user is not an attendee when dealing with web calendars. (-_toolbarForOwner:andClientObject:): no toolbar should appear diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 4b1fa48d9..b07caaf07 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -269,21 +269,22 @@ static NSArray *tasksFields = nil; static NSString *fields[] = { @"startDate", @"c_startdate", @"endDate", @"c_enddate" }; - 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]]; - } - } + 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]]; + } + } aDateValue = [aRecord objectForKey: @"c_recurrence_id"]; aDate = [aRecord objectForKey: @"cycleStartDate"]; @@ -354,8 +355,7 @@ static NSArray *tasksFields = nil; [self _fixComponentTitle: newInfo withType: component]; // Possible improvement: only call _fixDates if event is recurrent // or the view range span a daylight saving time change - if (dayBasedView) - [self _fixDates: newInfo]; + [self _fixDates: newInfo]; [infos addObject: [newInfo objectsForKeys: fields notFoundMarker: marker]]; }