Skip to content

forget

Lets the calendar forget what is old, so a screen left open — supervision, a wallboard — does not grow for ever.

Type{ readonly olderThan: DurationLike } | null
Defaultnot set
Live update (update())Yes
Declared inpackages/dom/src/settings.ts

Each minute, the events that ended more than olderThan ago leave the calendar — whatever their source, the events option included. It is not a person’s change: nothing to undo, no onEventChange. An event still running (ongoing) stays, and so does a series (its occurrences are made from its rule). olderThan is days, hours and minutes ({ days: 7 }, 'PT12H'); months, weeks, or nothing, throw a RangeError. null keeps everything. A source that delivers a forgotten event again brings it back, as it would any event it sends.

import { createCalendar } from '@dzcalendar/dom';
import '@dzcalendar/pro';
createCalendar(element, {
timeZone: 'Europe/Paris',
initialView: 'resourceTimelineDay',
resources: [{ id: 'import', title: 'Import' }],
timeline: { span: { hours: 4 }, follow: true },
// A week of history on screen, no more.
forget: { olderThan: { days: 7 } },
});

In Angular and Vue it goes in options; in React it is a prop.