The DayPilot.Calendar constructor creates a JavaScript calendar instance bound to a placeholder element and optionally initializes it using a configuration object.
new DayPilot.Calendar(id, options)id (string) - id of the placeholder <div> element
options (object) - configuration object that can include DayPilot.Calendar Properties, DayPilot.Calendar Events, and the special members listed below
In addition to the standard properties and events, it accepts the following special properties:
events - initial event array that will be loaded to DayPilot.Calendar.events.list
scrollToHour - initial scroll position hour
HTML
<div id="dpc"></div>JavaScript
const calendar = new DayPilot.Calendar("dpc");
calendar.init();Initialization with properties
const calendar = new DayPilot.Calendar("dpc", {
viewType: "Week",
onEventClick: args => {
alert("Event clicked: " + args.e.text());
},
scrollToHour: 10
});
calendar.init();