select-slot
Description
Fires when selecting a slot
Usage
"select-slot": ({
id: string | number,
time:[ number, number ]
}) => void;
Parameters
The callback of the select-slot event can take an object with the following parameters:
id
- (required) the ID of a card the selected slot belongs totime
- (required) an array with the slot start time in milliseconds and the slot duration in minutes (timestamps are in a local timezone)
Example
// create Booking
const booking = new booking.Booking("#root", {
data,
// other configuration parameters
});
// output the id of the selected slot
booking.api.on("select-slot", (obj) => {
console.log(obj.id);
});