Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'allDay' into 'master'
[nemo-qml-plugin-calendar] Save all day exception as ClockTime to be zone free. Contributes to JB#43311

See merge request mer-core/nemo-qml-plugin-calendar!49
  • Loading branch information
chriadam committed Apr 7, 2020
2 parents 6333589 + 4493e65 commit b62f016
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/calendarworker.cpp
Expand Up @@ -299,8 +299,11 @@ void CalendarWorker::replaceOccurrence(const CalendarData::Event &eventData, con
return;
}

// Note: occurrence given in local time. Thus if timezone changes between fetching and changing, this won't work
KDateTime occurrenceTime = KDateTime(startTime, KDateTime::LocalZone);
// Note: for all day events, to guarantee that exception set in a given time
// zone is also an exception when travelling to another time, we use the
// ClockTime spec.
KDateTime::SpecType spec(event->allDay() ? KDateTime::ClockTime : KDateTime::LocalZone);
KDateTime occurrenceTime(startTime, spec);

KCalCore::Incidence::Ptr replacementIncidence = mCalendar->dissociateSingleOccurrence(event,
occurrenceTime,
Expand Down

0 comments on commit b62f016

Please sign in to comment.