The events.add() method adds a new event to the monthly calendar component.
DayPilot.Month.events.add(e[, data]);e (DayPilot.Event or a raw data object) - item to be created
data (object) - custom data to be sent to the server side with the Notify event (ASP.NET WebForms, ASP.NET MVC, and Java versions only)
Returns a DayPilot.Action object that stores the action details.
You can pass either a DayPilot.Event instance or a raw event data object.
When you provide the optional data parameter, it is sent to the server with the Notify event in ASP.NET WebForms, ASP.NET MVC, and Java versions.
Create a new event:
const event = {
start: DayPilot.Date.today(),
end: DayPilot.Date.today().addDays(1),
text: "New calendar event",
id: 1,
};
dp.events.add(event);Client-Side Event API [doc.daypilot.org]