mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-27 16:53:28 +01:00
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)
|
||||
|
||||
if (event.getIsAllDay() && endTS > startTS) {
|
||||
event.startTS = Formatter.getShiftedImportTimestamp(event.startTS)
|
||||
event.endTS = Formatter.getShiftedImportTimestamp(event.endTS)
|
||||
event.endTS -= DAY
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user