Fix negative offset when saving an all-day event

pull/213/head
Francis Lachapelle 2016-06-07 10:09:25 -04:00
parent c6f6f7896c
commit bba673e0ef
1 changed files with 9 additions and 3 deletions

View File

@ -338,8 +338,9 @@
- (void) setAttributes: (NSDictionary *) data
inContext: (WOContext *) context
{
NSCalendarDate *aptStartDate, *aptEndDate;
NSInteger nbrDays;
NSCalendarDate *aptStartDate, *aptEndDate, *allDayStartDate;
NSInteger offset, nbrDays;
NSTimeZone *timeZone;
iCalDateTime *startDate;
iCalTimeZone *tz;
SOGoUserDefaults *ud;
@ -380,7 +381,12 @@
}
nbrDays = ((float) abs ([aptEndDate timeIntervalSinceDate: aptStartDate]) / 86400) + 1;
[self setAllDayWithStartDate: aptStartDate
timeZone = [aptStartDate timeZone];
offset = [timeZone secondsFromGMTForDate: aptStartDate];
allDayStartDate = [aptStartDate dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: offset];
[self setAllDayWithStartDate: allDayStartDate
duration: nbrDays];
}
else