DayPilot.Scheduler.zoomLevels

The zoomLevels property (array) specifies the Scheduler zoom levels.

Available since 2019.2.3860.

Items

Each item needs to contain an object called properties which specifies the values to be set during a zoom level change. It can contain other properties at the top level (such "name" in the example below) which will be ignored.

Each of the properties will be applied as a DayPilot.Scheduler property

If the item is a function, it will be executed and the result will be assigned to the specified Scheduler property. The function will receive an args object with the following structure as a parameter:

Default Value

[]

Example

dp.zoomLevels = [
  {
    name: "Year",
    properties: {
      scale: "Day",
      cellWidth: 40,
      timeHeaders: [{groupBy: "Year"}, {groupBy: "Month", format: "MMMM"}, {groupBy: "Day", format: "d"}],
      startDate: function (args) { return args.date.firstDayOfYear(); },
      days: function (args) { return args.date.daysInYear(); },
    }
  },
  {
    name: "Month",
    properties: {
      scale: "CellDuration",
      cellDuration: 720,
      cellWidth: 40,
      timeHeaders: [{groupBy: "Month"}, {groupBy: "Day", format: "ddd d"}, {groupBy: "Cell", format: "tt"}],
      startDate: function(args) { return args.date.firstDayOfMonth(); },
      days: function(args) { return args.date.daysInMonth();},
    }
  },
];