summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2016-06-19 07:04:52 -0400
committerDaniel Vrátil <[email protected]>2016-06-19 07:06:01 -0400
commitb9fd92245093e5c2778c4e484abb90bd23e887f9 (patch)
tree45d4eaafa3e29670b434df339a658801e56c2713
parent33032d5dc8593fe6bc7fd2e737f33ff45579f86a (diff)
PimEventsPlugin: fix start/end time of all-day events in different TZ
-rw-r--r--plugins/plasma/pimeventsplugin/eventdatavisitor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/plasma/pimeventsplugin/eventdatavisitor.cpp b/plugins/plasma/pimeventsplugin/eventdatavisitor.cpp
index ade0145..896b8e0 100644
--- a/plugins/plasma/pimeventsplugin/eventdatavisitor.cpp
+++ b/plugins/plasma/pimeventsplugin/eventdatavisitor.cpp
@@ -105,10 +105,16 @@ QVector<CalendarEvents::EventData> BaseEventDataVisitor::explodeIncidenceOccuren
QVector<CalendarEvents::EventData> results;
while (rec.isValid() && rec.date() <= mEnd) {
CalendarEvents::EventData copy = ed;
- const QDateTime dt = rec.dateTime();
+ QDateTime dt;
+ if (incidence->allDay()) {
+ dt = QDateTime(rec.date(), QTime(0, 0, 0), Qt::LocalTime);
+ } else {
+ dt = rec.toLocalZone().dateTime();
+ }
copy.setStartDateTime(dt);
copy.setEndDateTime(dt.addSecs(duration));
copy.setUid(generateUid(incidence, rec));
+
results.push_back(copy);
rec = incidence->recurrence()->getNextDateTime(rec);