Skip to content

useSelectedTimeSlot

Holds the time slot the visitor picked. book, reserve and reschedule read it; the Vue component emits time-slot-changed when it changes.

ts
import { useSelectedTimeSlot } from "@zaptime/core";

const { selectedTimeSlot, setSelectedTimeSlot } = useSelectedTimeSlot(calendarId?);

Selected time slot

ts
selectedTimeSlot.value; // TimeSlot | undefined

Set selected time slot

ts
setSelectedTimeSlot(timeSlot);
setSelectedTimeSlot(undefined); // clear, e.g. when leaving the booking form

useCalendar().selectTimeSlot(slot) is the same operation.