Concepts

Recurrence

When an event is not a one-off, we add a recurrent object to the event body, this consists of some meta keys that assist in describing the event, and one key "RRULE" for generating dates. The "RRULE" string uses the RRULE format, which is a standard format for describing recurring events. You can read more about it here.

This string is parimarily used to generate a list of isostrings for each day that an event is occurring, in order to display them on either the calendar or the booking platform. When the date of an event is created or modified, the RRULE string is modified to generate the new series of events. If, for example, a date is excluded from a series, we add a "YYYY-MM-DD" formatted string to the excludedDates array on the recurrence object. When we parse the the RRULE string, we filter these dates out from the generated results. In order to determine the end of the generated sequence, we use the "concluded" key of the event.


Recurrence object

Each event has a recurrence object:

{
  RRULE: 'RRULE STRING',
  recurring: true | false, // is this event recurring?
  type: 'YEARLY' | 'MONTHLY' | 'FORTNIGHTLY' | 'WEEKLY' | 'DAILY' | 'SPECIFIC' | 'WEEKDAY',
  childEvent: true | false, // is this a child event?
  dates?: ["2024-01-18", 2024-01-19] // For specific type, this is a list of the dates in YYYY-MM-DD format
  excludedDates?: ["2024-01-20"] // Any dates that an event will not run on.
}
Previous
Getting started