Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Fix Google Calendar multi-day all-day eve…
Browse files Browse the repository at this point in the history
…nt handling. Contributes to MER#1483

This commit fixes the Google Calendar sync plugin's handling of
multi-day all-day event handling.

Contributes to MER#1483
  • Loading branch information
Chris Adams committed Feb 26, 2016
1 parent cbd6688 commit c609f0d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/google/google-calendars/googlecalendarsyncadaptor.cpp
Expand Up @@ -466,7 +466,7 @@ void extractStartAndEnd(const QJsonObject &eventData,
*start = parsedStartTime.toLocalZone();
} else {
*start = KDateTime(QDate::fromString(startTimeString, QDATEONLY_FORMAT), QTime(), KDateTime::ClockTime);
// note: don't call start->setDateOnly(true); or mkcal doesn't like it.
start->setDateOnly(true);
}
}

Expand Down Expand Up @@ -501,13 +501,13 @@ void extractStartAndEnd(const QJsonObject &eventData,
// multi-day all-day event.
// as noted above, Google will send all-day events as having an end-date
// of real-end-date+1 in order to conform to iCal spec (exclusive end dt).
*start = KDateTime(QDate::fromString(startTimeString, QDATEONLY_FORMAT), QTime(), KDateTime::ClockTime);
*end = KDateTime(QDate::fromString(endTimeString, QDATEONLY_FORMAT).addDays(-1), QTime(), KDateTime::ClockTime);
*end = KDateTime(QDate::fromString(endTimeString, QDATEONLY_FORMAT), QTime(), KDateTime::ClockTime);
end->setDateOnly(true);
*isAllDay = true;
}
} else {
*end = KDateTime(QDate::fromString(endTimeString, QDATEONLY_FORMAT).addDays(-1), QTime(), KDateTime::ClockTime);
// note: don't call end->setDateOnly(true); or mkcal doesn't like it.
*end = KDateTime(QDate::fromString(endTimeString, QDATEONLY_FORMAT), QTime(), KDateTime::ClockTime);
end->setDateOnly(true);
*isAllDay = false;
}
}
Expand Down

0 comments on commit c609f0d

Please sign in to comment.