DayPilot.Scheduler.events.find

The events.find() method returns the event with the specified ID.

You can also provide a callback method that implements the search rule instead the event ID. In that case, the events.find() method returns the first event that matches the rule.

See also events.findAll().

Declaration

Using event ID as a parameter:

DayPilot.Scheduler.events.find(id);

Using custom find function as a parameter:

DayPilot.Scheduler.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-insensitive search using event text:

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