properly import all-day events from nextcloud type services
This commit is contained in:
parent
d343e8211f
commit
91d5c3dd00
|
@ -259,6 +259,8 @@ class CalDAVHandler(val context: Context) {
|
||||||
importId, allDay, repeatRule.repeatLimit, repeatRule.repeatRule, eventTypeId, source = source, location = location)
|
importId, allDay, repeatRule.repeatLimit, repeatRule.repeatRule, eventTypeId, source = source, location = location)
|
||||||
|
|
||||||
if (event.getIsAllDay() && endTS > startTS) {
|
if (event.getIsAllDay() && endTS > startTS) {
|
||||||
|
event.startTS = Formatter.getShiftedImportTimestamp(event.startTS)
|
||||||
|
event.endTS = Formatter.getShiftedImportTimestamp(event.endTS)
|
||||||
event.endTS -= DAY
|
event.endTS -= DAY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,4 +99,6 @@ object Formatter {
|
||||||
else
|
else
|
||||||
"0"
|
"0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getShiftedImportTimestamp(ts: Int) = getDateTimeFromTS(ts).toDateTime(DateTimeZone.UTC).withZoneRetainFields(DateTimeZone.getDefault()).withTime(5, 0, 0, 0).seconds()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue