See Changelog.

Monotone-Parent: 8871093b60112022ab57314a530ebc53dabf0d75
Monotone-Revision: a15dbfb88dbe373949a0883880ab6b6e0175e72b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-10T22:21:53
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle committed 2011-03-10 22:21:53 +00:00
1 parent 32539b0fde
commit 79629a9941
2 files changed
+14 -1

No files matched your search

+11 -1
View File
@@ -579,7 +579,7 @@ static NSNumber *sharedYes = nil;
/**
* Set the timezone of the event start and end dates to the user's timezone.
* @param theRecord an dictionnary with the attributes of the event.
* @param theRecord a dictionnary with the attributes of the event.
* @return a copy of theRecord with adjusted dates.
*/
- (NSMutableDictionary *) fixupRecord: (NSDictionary *) theRecord
@@ -590,6 +590,7 @@ static NSNumber *sharedYes = nil;
unsigned int count;
NSCalendarDate *date;
NSNumber *dateValue;
unsigned int offset;
record = [[theRecord mutableCopy] autorelease];
for (count = 0; count < 2; count++)
@@ -601,6 +602,15 @@ static NSNumber *sharedYes = nil;
if (date)
{
[date setTimeZone: timeZone];
if ([[theRecord objectForKey: @"c_isallday"] boolValue])
{
// Since there's no timezone associated to all-day events,
// their time must be adjusted for the user's timezone.
offset = [timeZone secondsFromGMTForDate: date];
date = (NSCalendarDate*)[date dateByAddingYears:0 months:0 days:0 hours:0 minutes:0
seconds:-offset];
[record setObject: [NSNumber numberWithInt: [dateValue intValue] - offset] forKey: fields[count * 2]];
}
[record setObject: date forKey: fields[count * 2 + 1]];
}
}