properly import all-day events from nextcloud type services

This commit is contained in:
tibbi 2018-02-10 11:14:18 +01:00
parent d343e8211f
commit 91d5c3dd00
2 changed files with 4 additions and 0 deletions

View File

@ -259,6 +259,8 @@ class CalDAVHandler(val context: Context) {
importId, allDay, repeatRule.repeatLimit, repeatRule.repeatRule, eventTypeId, source = source, location = location)
if (event.getIsAllDay() && endTS > startTS) {
event.startTS = Formatter.getShiftedImportTimestamp(event.startTS)
event.endTS = Formatter.getShiftedImportTimestamp(event.endTS)
event.endTS -= DAY
}

View File

@ -99,4 +99,6 @@ object Formatter {
else
"0"
}
fun getShiftedImportTimestamp(ts: Int) = getDateTimeFromTS(ts).toDateTime(DateTimeZone.UTC).withZoneRetainFields(DateTimeZone.getDefault()).withTime(5, 0, 0, 0).seconds()
}