Skip to main content

select-slot

Description

Fires when selecting a slot

Usage

"select-slot": ({
cardId: string | number,
slotTime: {
from?: Date,
to?: Date,
}
}) => void;

Parameters

The callback of the select-slot event can take an object with the following parameters:

  • cardId - (required) the ID of a card a selected slot belongs to
  • slotTime - (required) an object with the slot time parameters. In this object you can specify the following parameters:
    • from - (optional) the slot start date
    • to - (optional) the slot end date

Example

// create Booking
const booking = new booking.Booking("#root", {
cards,
cardShape
});

// ...
booking.api.on("select-slot", (obj) => {
console.log(obj.cardId);
});

Related articles: TODO