The DayPilot.Calendar constructor creates a JavaScript calendar instance bound to a placeholder element and optionally initializes it using a configuration object.
Declaration
new DayPilot.Calendar(id, options)Parameters
id(string) - id of the placeholder<div>elementoptions(object) - configuration object that can include DayPilot.Calendar Properties, DayPilot.Calendar Events, and the special members listed below
Notes
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.listscrollToHour- initial scroll position hour
Example
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();See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot