mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix some glitches at parsing CalDAV synced Exdates
This commit is contained in:
@@ -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
|
// 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) ?: ""
|
val exdate = cursor.getStringValue(Events.EXDATE) ?: ""
|
||||||
if (exdate.length > 8) {
|
if (exdate.length > 8) {
|
||||||
val lines = exdate.split("\n")
|
val lines = exdate.split("\n")
|
||||||
for (line in lines) {
|
for (line in lines) {
|
||||||
val dates = line.split(",")
|
val dates = line.split(",")
|
||||||
dates.forEach {
|
dates.filter { it.isNotEmpty() && it[0].isDigit() }.forEach {
|
||||||
if (it.endsWith("Z")) {
|
if (it.endsWith("Z")) {
|
||||||
// convert for example "20190216T230000Z" to "20190217000000" in Slovakia in a weird way
|
// convert for example "20190216T230000Z" to "20190217000000" in Slovakia in a weird way
|
||||||
val formatter = DateTimeFormat.forPattern("yyyyMMdd'T'HHmmss'Z'")
|
val formatter = DateTimeFormat.forPattern("yyyyMMdd'T'HHmmss'Z'")
|
||||||
|
Reference in New Issue
Block a user