AndroidTimeUtils

Properties

Link copied to clipboard
const val TZID_UTC: String

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

Functions

Link copied to clipboard
fun <T : DateListProperty<*>> androidStringToRecurrenceSet(dbStr: String, allDay: Boolean, exclude: Instant? = 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

Returns the timezone ID that should be used when writing an event to the Android calendar provider or task providers.

Link copied to clipboard

Checks and fixes 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 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 (yyyymmdd[Z]) values, where the time zone is stored in a separate field.

Link copied to clipboard

Converts this Temporal to an Instant that should be used when working with temporal values.

Link copied to clipboard

Same as toInstant, but returns a UNIX timestamp (in milliseconds) instead of an Instant.

Link copied to clipboard

Converts this Temporal to a ZonedDateTime that is created from the timestamp returned by toTimestamp and the time zone returned by androidTimezoneId.