The events.find() method finds the specified event. To find an event, you can use its id or a custom search function.
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);
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
DayPilot.Event object or null. If there are more events with the same id, it returns the first one.
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()));