Commit e27ef288 authored by Volker Krause's avatar Volker Krause
Browse files

Set better event times when importing full-day events

All day events are always in (floating) local time, we do not want to
accidentally use the local device timezone for this.
parent f1e19681
Pipeline #197050 passed with stage
in 4 minutes and 37 seconds
......@@ -63,10 +63,16 @@ static QVariant convertToEvent(const KCalendarCore::Event::Ptr &ev)
Event e;
e.setName(ev->summary());
e.setDescription(ev->description());
e.setStartDate(ev->dtStart());
e.setEndDate(ev->dtEnd());
e.setUrl(ev->url());
if (ev->allDay()) {
e.setStartDate(QDateTime(ev->dtStart().date(), {0, 0}, Qt::LocalTime));
e.setEndDate(QDateTime(ev->dtEnd().date(), {23, 59, 59}, Qt::LocalTime));
} else {
e.setStartDate(ev->dtStart());
e.setEndDate(ev->dtEnd());
}
Place venue;
venue.setName(ev->location()); // TODO attempt to detect addresses in here
if (ev->hasGeo()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment