Skip to Content
ReferenceConfiguration

Configuration

Options for generateTimeslots() (and, except where noted, the other generators). All options except range and slotDurationMinutes are optional.

OptionTypeDefaultDescription
rangeTimeslotRangeInputrequiredStart and end boundaries for slot generation. Accepts Dates, ISO strings, or time-only strings like "09:00".
slotDurationMinutesnumberrequiredLength of each slot in minutes. Must be positive.
dayDate | stringnoneCalendar date to anchor time-only boundaries, e.g. day: '2024-03-15' with range: { start: '09:00', end: '17:00' }.
slotIntervalMinutesnumberslotDurationMinutesStep between consecutive slot starts. Set lower than the duration to create overlapping slots.
bufferBeforeMinutesnumber0Minutes trimmed from the start of the usable window before generating slots.
bufferAfterMinutesnumber0Minutes trimmed from the end of the usable window before generating slots.
excludedWindowsTimeslotRangeInput[]noneSub-ranges to exclude (lunch breaks, blackouts). Overlapping exclusions are merged automatically.
timezonestringnoneIANA timezone id (e.g. "America/New_York", "UTC"). Controls how time-only strings are interpreted.
alignment'start' | 'end' | 'center''start'How to handle leftover time that doesn’t fill a complete slot. 'start' discards at the end, 'end' aligns backward from the range end, 'center' distributes leftover on both sides.
minimumSlotDurationMinutesnumberslotDurationMinutesMinimum duration for partial/edge slots. Only relevant when includeEdge is true.
includeEdgebooleantrueWhether to include truncated edge slots (cut short by the range boundary or an exclusion) when they meet the minimum duration.
maxSlotsnumbernoneHard limit on the number of slots generated. Generation stops once this count is reached.
minimumNoticeMinutesnumbernoneLead time before a slot can be booked. Slots starting before now + minimumNoticeMinutes are dropped. Must be non-negative.
maximumAdvanceDaysnumbernoneHow far ahead bookings are allowed, in whole calendar days. Slots starting at or after the same wall-clock time that many days from now (in timezone) are dropped. Must be a positive integer.
nowDate | stringnew Date()Reference “current time” for the two options above. Set it to make output deterministic, or to gate against a server clock. Ignored when neither option is set.
labelFormatter(slot, index, durationMinutes) => stringnoneCallback to attach a custom label to each slot’s metadata. Return undefined to skip.

The booking-window options apply to every generator. Filtering looks at each slot’s start time, and the bookable span is half-open: a slot starting exactly at the notice boundary is kept, one starting exactly at the advance cutoff is not. Unbookable slots are removed before maxSlots is applied, so the cap counts bookable slots only. See Booking windows.

Additional DailyTimeslotConfig options

generateDailyTimeslots() accepts all of the above (except day, which is set automatically per day), plus:

OptionTypeDefaultDescription
rangeTimeslotRangeInput | Map<Weekday, TimeslotRangeInput | null>requiredEither a single range applied to every day, or a Map for per-weekday schedules. Weekdays absent from the map are skipped.
maxDaysnumber10000Safety limit on the number of calendar days to iterate, so a bad period can’t loop forever.

Additional AvailableTimeslotConfig options

generateAvailableTimeslots() accepts all single-day options, plus:

OptionTypeDefaultDescription
busyTimeslotRangeInput[]noneBooked events to subtract from availability (block everyone).
participantsBusyTimeslotRangeInput[][]nonePer-person busy sets. When present, results are narrowed to windows where every participant is free.
Last updated on