Fix offset when converting event to all-day

Fixes #3655
pull/210/head
Francis Lachapelle 2016-05-20 10:05:03 -04:00
parent 03bbe63cdc
commit 0e2c6dc5cd
2 changed files with 2 additions and 8 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ Bug fixes
- [web] fixed composition of new messages from Contacts module
- [web] fixed autocompletion of LDAP-based groups (#3673)
- [web] fixed month view when current month covers six weeks (#3663)
- [web] fixed negative offset when converting a regular event to an all-day event (#3655)
3.1.0 (2016-05-18)
------------------

View File

@ -371,14 +371,7 @@
if (isAllDay)
{
nbrDays = ((float) abs ([aptEndDate timeIntervalSinceDate: aptStartDate]) / 86400) + 1;
// Convert all-day start date to GMT (floating date)
ud = [[context activeUser] userDefaults];
timeZone = [ud timeZone];
offset = [timeZone secondsFromGMTForDate: aptStartDate];
allDayStartDate = [aptStartDate dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: offset];
[self setAllDayWithStartDate: allDayStartDate
[self setAllDayWithStartDate: aptStartDate
duration: nbrDays];
}
else