The update() method applies configuration and data changes and refreshes the monthly calendar component, including headers, background cells, and events.
DayPilot.Month.update([options]);options (object, optional) - object with properties and events to be updated
The options object can specify any of the top-level calendar properties.
In addition to the standard properties, the following special property is supported:
events - an array of events that is saved to events.list before the calendar is updated
There are two ways to update the calendar properties.
Change the properties directly and call update() without parameters:
// initialization
const month = new DayPilot.Month("month", {
startDate: DayPilot.Date.today()
});
month.init();
// ...
// update
month.startDate = DayPilot.Date.today().addMonths(1);
month.events.list = [ /* ... event data ... */ ];
month.update();Pass the properties to be changed using the options parameter:
// initialization
const month = new DayPilot.Month("month", {
startDate: DayPilot.Date.today()
});
month.init();
// ...
// update
month.update({
startDate: DayPilot.Date.today().addMonths(1),
events: [ /* ... event data ... */ ]
});