From 263dec79df20ea491a154808de9c68e0a06a5755 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 10 Mar 2021 16:18:11 +0100 Subject: [PATCH] fix some glitches at parsing CalDAV synced Exdates --- .../com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt index 335b36188..f00ce3da5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt @@ -240,12 +240,13 @@ class CalDAVHelper(val context: Context) { } // some calendars add repeatable event exceptions with using the "exdate" field, not by creating a child event that is an exception + // exdate can be stored as "20190216T230000Z", but also as "Europe/Madrid;20201208T000000Z" val exdate = cursor.getStringValue(Events.EXDATE) ?: "" if (exdate.length > 8) { val lines = exdate.split("\n") for (line in lines) { val dates = line.split(",") - dates.forEach { + dates.filter { it.isNotEmpty() && it[0].isDigit() }.forEach { if (it.endsWith("Z")) { // convert for example "20190216T230000Z" to "20190217000000" in Slovakia in a weird way val formatter = DateTimeFormat.forPattern("yyyyMMdd'T'HHmmss'Z'")