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 fielddate
- (optional) the slot datetime
- (optional) an array of objects containing time options for a slot. For each object, you can specify the following parameters:from
- (optional) the start timeto
- (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