mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 23:12:40 +00:00
Added proper support for BYxxx recurrent masks.
See ChangeLog Monotone-Parent: 1388a39a062a16e073dca526237e1b25d5fa19d7 Monotone-Revision: 0e9f9326c164b5f5513aeb461785100c6c18fd0e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-04-19T21:05:35 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
97e9fb3e67
commit
6e1ee64101
16 files changed
+1105
-646
No files matched your search
@@ -273,27 +273,28 @@ 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];
|
||||
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]];
|
||||
}
|
||||
}
|
||||
if (dayBasedView)
|
||||
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"];
|
||||
aStartDate = [aRecord objectForKey: @"startDate"];
|
||||
if (aDateValue && aDate)
|
||||
{
|
||||
aStartDate = [aRecord objectForKey: @"startDate"];
|
||||
if ([userTimeZone isDaylightSavingTimeForDate: aStartDate] !=
|
||||
[userTimeZone isDaylightSavingTimeForDate: aDate])
|
||||
{
|
||||
@@ -387,11 +388,9 @@ static NSArray *tasksFields = nil;
|
||||
forKey: @"c_owner"];
|
||||
if (![[newInfo objectForKey: @"c_title"] length])
|
||||
[self _fixComponentTitle: newInfo withType: component];
|
||||
if (dayBasedView
|
||||
|| [[newInfo objectForKey: @"c_isallday"] boolValue])
|
||||
// Possible improvement: only call _fixDates if event is recurrent
|
||||
// or the view range span a daylight saving time change
|
||||
[self _fixDates: newInfo];
|
||||
// Possible improvement: only call _fixDates if event is recurrent
|
||||
// or the view range span a daylight saving time change
|
||||
[self _fixDates: newInfo];
|
||||
[infos addObject: [newInfo objectsForKeys: fields
|
||||
notFoundMarker: marker]];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user