DayPilot.Month.events.add

The events.add() method adds a new event to the monthly calendar component.

Declaration

DayPilot.Month.events.add(e[, data]);

Parameters

  • e (DayPilot.Event or a raw data object) - event 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)

Return Value

DayPilot.Action object that stores the action details.

Example

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);