DayPilot.Calendar.events.find

The events.find() method finds the specified event. To find an event, you can use its id or a custom search function.

Declaration

Using event ID as a parameter:

DayPilot.Calendar.events.find(id);

Using custom find function as a parameter (since version2023.3.5603):

DayPilot.Calendar.events.find(f); 

Parameters

  • id (string | number) - id of the event to be found 

  • f (function) - find function that returns true if the search condition is met

Find function syntax:

function f(e) {}

Find function parameters:

Return Value

DayPilot.Event object or null. If there are more events with the same id, it returns the first one.

Example

Case-sensitive search:

const query = "meeting";
const e = dp.events.find(e => e.text().includes(query));

Case-insensitive search:

const query = "meeting";
const e = dp.events.find(e => e.text().toUpperCase().includes(query.toUpperCase()));