Fix off-by-one with dates stored in ICAL, due to LocalZone/UTC confusion.
ClosedPublic

Authored by dfaure on Jun 13 2016, 8:12 AM.

Details

Summary

Issue 1:

KDateTime(date) uses LocalZone, while we want UTC since the loading
code converts to UTC. Before this fix, setting June 1st in the GUI
would be stored as
DTSTART;TZID=Europe/Paris:20160601T000000
and then loaded back with this code
task->setStartDate(todo->dtStart().dateTime().toUTC());
which leads to 20150531 23:00:00 UTC, i.e. one day before.

Using UTC for every KDateTime(date) conversion fixes this,
and avoids 3K of VTIMEZONE information in each (!) icaldir file.

Issue 2:

The QDateTime set by the GUI has to be in UTC too, to avoid conversions.

Diff Detail

Repository
R4 Zanshin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure updated this revision to Diff 4372.Jun 13 2016, 8:12 AM
dfaure retitled this revision from to Fix off-by-one with dates stored in ICAL, due to LocalZone/UTC confusion..
dfaure updated this object.
dfaure edited the test plan for this revision. (Show Details)
dfaure added a reviewer: ervin.
ervin accepted this revision.Jun 28 2016, 4:05 PM
ervin edited edge metadata.
This revision is now accepted and ready to land.Jun 28 2016, 4:05 PM
dfaure closed this revision.Jun 28 2016, 8:22 PM