Skip to content

availableSlots

Free slots a person can book, drawn in the week and day views.

Typereadonly AvailableSlot[] | null
Defaultnull
Live update (update())Yes
Declared inpackages/core/src/kernel.ts

Each slot is { start, end } — Instants or ZonedDateTimes — and, optionally, resourceId (only that resource’s columns show it) and seats (said beside its time). They usually come from findSlots (@dzcalendar/slots), which works out a provider’s free time from its hours, what is busy and the booking rules — the same code on the page and on the server.

A slot is drawn in its column (in every column without a resourceId); with onSlotClick it can be clicked (or reached with the keyboard and Enter) and receives the slot as given — without it, slots are shown only. seats is said when it is a whole number of 1 or more. findSlots gives { start, end }; resourceId and seats are yours to add (or @dzcalendar/pro/slots’). The calendar creates nothing: the application books it, and its server checks it again (checkSlot) before saving. null: no slots. A new array redraws; the same array again changes nothing.

import { Temporal, loadTemporal } from '@dzcalendar/core';
import { createCalendar } from '@dzcalendar/dom';
import { findSlots } from '@dzcalendar/slots';
await loadTemporal();
const { slots } = findSlots({
availability: { timeZone: 'Europe/Paris', weekly: [{ days: [1, 2, 3, 4, 5], from: '09:00', to: '12:00' }] },
duration: 30,
from: Temporal.ZonedDateTime.from('2026-10-19T00:00[Europe/Paris]'),
to: Temporal.ZonedDateTime.from('2026-10-24T00:00[Europe/Paris]'),
busy: [],
});
const calendar = createCalendar(element, {
timeZone: 'Europe/Paris',
availableSlots: slots,
onSlotClick: (slot) => fetch('/api/book', { method: 'POST', body: JSON.stringify({ start: slot.start.toString() }) }),
});
// Later: none.
calendar.update({ availableSlots: null });

In the frameworks it is an input: Angular’s availableSlots, React’s availableSlots, Vue’s available-slots; the click is Angular’s (slotClick), React’s onSlotClick, Vue’s @slot-click.

Three free slots on Wednesday morning, drawn among the events.