fix #466, replace empty repetition rule with null at non-repeating events

This commit is contained in:
tibbi 2018-05-04 14:24:44 +02:00
parent 42ddaa6b49
commit a350396ece

View File

@ -358,11 +358,17 @@ class CalDAVHandler(val context: Context) {
put(CalendarContract.Events.DESCRIPTION, event.description)
put(CalendarContract.Events.DTSTART, event.startTS * 1000L)
put(CalendarContract.Events.ALL_DAY, if (event.getIsAllDay()) 1 else 0)
put(CalendarContract.Events.RRULE, Parser().getRepeatCode(event))
put(CalendarContract.Events.EVENT_TIMEZONE, TimeZone.getDefault().toString())
put(CalendarContract.Events.EVENT_LOCATION, event.location)
put(CalendarContract.Events.STATUS, CalendarContract.Events.STATUS_CONFIRMED)
val repeatRule = Parser().getRepeatCode(event)
if (repeatRule.isEmpty()) {
putNull(CalendarContract.Events.RRULE)
} else {
put(CalendarContract.Events.RRULE, repeatRule)
}
if (event.getIsAllDay() && event.endTS > event.startTS)
event.endTS += DAY