AndroidTimeUtils

Properties

Link copied to clipboard

Used to separate multiple RRULEs/EXRULEs in the RRULE/EXRULE storage field.

Link copied to clipboard

Timezone ID to store for all-day events, according to CalendarContract.Events SDK documentation.

Functions

Link copied to clipboard
fun androidifyTimeZone(dateList: DateListProperty)

Ensures that a given DateListProperty either

fun androidifyTimeZone(date: DateProperty?)

Ensures that a given DateProperty either

Link copied to clipboard
fun <T : DateListProperty> androidStringToRecurrenceSet(dbStr: String, allDay: Boolean, exclude: Long? = null, generator: (DateList) -> T): T

Takes a formatted string as provided by the Android calendar provider and returns a DateListProperty constructed from these values.

Link copied to clipboard

Checks and fixes Event.duration values with incorrect format which can't be parsed by ical4j. Searches for values like "1H" and "3M" and groups them together in a standards-compliant way.

Link copied to clipboard
fun recurrenceSetsToAndroidString(dates: List<DateListProperty>, dtStart: Date): String

Concatenates, if necessary, multiple RDATE/EXDATE lists and converts them to a formatted string which Android calendar provider can process.

Link copied to clipboard
fun recurrenceSetsToOpenTasksString(dates: List<DateListProperty>, tz: TimeZone?): String

Concatenates, if necessary, multiple RDATE/EXDATE lists and converts them to a formatted string which OpenTasks can process. OpenTasks expect a list of RFC 5545 DATE ("yyyymmdd") or DATE-TIME ("yyyymmddZ") values, where the time zone is stored in a separate field.

Link copied to clipboard
fun storageTzId(date: DateProperty): String

Returns the time-zone ID for a given date or date-time that should be used to store it in the Android calendar provider.