Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sociald] Fix upsync of all-day calendar events to Google. Contribute…
…s to JB#16980

Google assumes that the end-date of all-day events will be reported
as end-date+1 to conform to iCal requirement that the end-date is
exclusive.

Contributes to JB#16980
  • Loading branch information
Chris Adams committed Mar 20, 2014
1 parent e7cb894 commit 7cef8da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/google/googlecalendarsyncadaptor.cpp
Expand Up @@ -77,7 +77,8 @@ QJsonObject kCalToJson(KCalCore::Event::Ptr event, KCalCore::ICalFormat &icalFor
start.insert(QLatin1String("timeZone"), QJsonValue(event->dtStart().toString(KLONGTZ_FORMAT)));
}
if (event->dtEnd().isDateOnly() || (event->allDay() && event->dtEnd().time() == QTime(0,0,0))) {
end.insert(QLatin1String("date"), event->dateEnd().toString(QDATEONLY_FORMAT));
// note: for iCal spec, allDay events need to have an end date of real-end-date+1 as end date is exclusive.
end.insert(QLatin1String("date"), event->dateEnd().addDays(1).toString(QDATEONLY_FORMAT));
} else {
end.insert(QLatin1String("dateTime"), event->dtEnd().toString(RFC3339_FORMAT));
end.insert(QLatin1String("timeZone"), QJsonValue(event->dtEnd().toString(KLONGTZ_FORMAT)));
Expand Down

0 comments on commit 7cef8da

Please sign in to comment.