Skip to main content

set-filter

Description

Fires when filtering cards

Usage

"set-filter": ({
global?: string,
date?: string,
time?: [
{
from?: number,
to?: number,
}, {...}
],
}) => void;

Parameters

The callback of the set-filter event can take an object with the following parameters:

  • global - (optional) the text in the search field
  • date - (optional) the slot date
  • time - (optional) an array of objects containing time options for a slot. For each object, you can specify the following parameters:
    • from - (optional) the start time
    • to - (optional) the end time

Example

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

// ...
booking.api.on("set-filter", (obj) => {
console.log(obj.time);
});

Related articles: TODO