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 |
|---|---|
| Default | not set |
Live update (update()) | Yes |
| Declared in | packages/dom/src/settings.ts |
What it does
Section titled “What it does”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.
Example
Section titled “Example”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 } },});import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';import '@dzcalendar/pro';
@Component({ selector: 'app-supervision', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" view="resourceTimelineDay" [resources]="processes" [options]="options" />`,})export class Supervision { readonly processes = [{ id: 'import', title: 'Import' }]; readonly options = { timeline: { span: { hours: 4 }, follow: true }, forget: { olderThan: { days: 7 } } };}import { DzCalendar } from '@dzcalendar/react';import '@dzcalendar/pro';
const PROCESSES = [{ id: 'import', title: 'Import' }];const WEEK = { olderThan: { days: 7 } };
export function Supervision() { return <DzCalendar timeZone="Europe/Paris" defaultView="resourceTimelineDay" resources={PROCESSES} forget={WEEK} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';import '@dzcalendar/pro';
const processes = [{ id: 'import', title: 'Import' }];const options = { timeline: { span: { hours: 4 }, follow: true }, forget: { olderThan: { days: 7 } } };</script>
<template> <DzCalendar time-zone="Europe/Paris" view="resourceTimelineDay" :resources="processes" :options="options" /></template>In Angular and Vue it goes in options; in React it is a prop.
See also
Section titled “See also”events—ongoing: an event still running stays.timeline—followandspan, for a screen that watches the present.- Live supervision.