The events.find() method finds an event in the Month event collection using an event id or a custom search function.
Using an event id:
DayPilot.Month.events.find(id);Using a custom search function (available since 2023.3.5603):
DayPilot.Month.events.find(f);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:
e (DayPilot.Event) - object to test
Returns a matching DayPilot.Event instance or null. If there are more events with the same id, it returns the first one.
Use the predicate overload when the search depends on event properties instead of the event id.
The returned DayPilot.Event instance can be inspected or updated using the client-side event API.
Case-sensitive search:
const query = "inspection";
const e = dp.events.find(e => e.text().includes(query));Case-insensitive search:
const query = "order";
const e = dp.events.find(e => e.text().toUpperCase().includes(query.toUpperCase()));Client-Side Event API [doc.daypilot.org]