Skip to content

historyLimit

How many changes the undo history keeps.

Typenumber
Default200
Live update (update())No — at creation only
Declared inpackages/core/src/kernel.ts

Every command — a person’s drag or resize, a command your code runs with calendar.run() — is one entry of the history (loading events is not): calendar.undo() and calendar.redo() walk it, and so do Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z in an editable calendar (keyboardUndo). Past this many entries, the oldest are forgotten.

It is read when the calendar is made.

import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', editable: true, historyLimit: 50 });
document.getElementById('undo')!.addEventListener('click', () => calendar.undo());

In Angular it goes in the defaults (DZ_CALENDAR_DEFAULTS, provideDzCalendar); in React and Vue, in initial.