DayPilot.Month.update

The update() method applies configuration and data changes and refreshes the monthly calendar component (including headers, background cells, events).

Declaration

DayPilot.Month.update([options]);

Parameters

  • options - object with properties and events to be updated (object)

Special Properties

The options object can specify any of the top-level calendar properties. In addition to the standard properties, the following special properties are supported:

  • events - the value (array of events) will be saved to events.list before update

Examples

There are two ways to update the calendar properties:

1. 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();

2. Specify 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 ... */ ]
});