Event management: fields, sorting, and availability.

Events come in two types:

  • Standard — fixed capacity with optional date
  • Daily — date-based booking with holiday exclusions

Functions

f
addDays

Add days to a YYYY-MM-DD date string

f
eventDateToCalendarDate

Convert a UTC ISO datetime to a YYYY-MM-DD calendar date in the given timezone. Returns null if the input is empty or invalid. Used by the calendar view to map standard event dates to calendar days.

f
formatDateLabel

Format a YYYY-MM-DD date for display. Returns "Monday 15 March 2026"

f
formatDatetimeLabel

Format an ISO datetime string for display in the given timezone. Returns e.g. "Monday 15 June 2026 at 14:00 BST"

f
getAvailableDates

Compute available booking dates for a daily event. Filters by bookable days of the week and excludes holidays. Returns sorted array of YYYY-MM-DD strings.

f
getNextBookableDate

Get the next available booking date for a daily event. More efficient than getAvailableDates()[0] — stops at first match. Returns null if no bookable dates are available.

f
mergeEventFields

Determine which contact fields to collect for multiple events. Returns the union of all field settings, sorted by canonical CONTACT_FIELDS order.

f
normalizeDatetime

Normalize datetime-local "YYYY-MM-DDTHH:MM" to full UTC ISO string. The input is interpreted as local time in the given timezone and converted to UTC.

f
parseEventFields

Parse a comma-separated fields string into individual ContactField names

f
sortEvents

Sort events in unified 3-tier order. Works with any Event subtype (Event, EventWithCount, etc.).

Interfaces

I
EventWithCount
No documentation available

Variables

v
DAY_NAMES

Day name lookup from Date.getUTCDay() index (Sunday=0)