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
2011-03-10 22:21:53 +00:00
parent 32539b0fde
commit 79629a9941
2 changed files with 14 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
2011-03-10 Francis Lachapelle <flachapelle@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m (-fixupRecord):
the time of all-day events must be adjusted for the user's timezone.
* UI/WebServerResources/UIxContactEditor.js (initEditorForm):
the input category field doesn't appear if the card is
read-only. Adjusted the code accordingly.
+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]];
}
}