RecurrenceFinder

Utility object to find the dates of the events of a Recurrence object. All date parameters are given as millis since UTC epoch time. This class is not thread-safe.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The timezone used for finding recurrence events. Note that changing this doesn't change the fact that all date parameters are in UTC millis since epoch time.

Functions

Link copied to clipboard
fun find(r: Recurrence, startDate: Long, amount: Int, fromDate: Long = Recurrence.DATE_NONE, includeStart: Boolean = true): MutableList<Long>

Get an amount of event dates of a recurrence after a date. All events will have the same time of the day as the startDate. See findBasedOn for more information.

Link copied to clipboard
fun findBasedOn(r: Recurrence, startDate: Long, base: Long, baseCount: Int, amount: Int, fromDate: Long = Recurrence.DATE_NONE, includeStart: Boolean = true): MutableList<Long>

Get event dates of a recurrence based on a previous event date of the same recurrence. If the recurrence has an end by count rule, it's important to also supply the base count to indicate how many events have happened as of the base date so the algorithm knows when to stop. Starting from a date, a certain amount of events are found and returned. All events will have the same time of the day as the startDate.

Link copied to clipboard
fun findBetween(r: Recurrence, startDate: Long, start: Long, end: Long): MutableList<Long>

Get event dates of a recurrence between a start date (inclusive) and an end date (exclusive).