Skip to content

autoPrint

Lets the browser’s print draw the whole calendar: everything mounted before, put back after.

Typeboolean
Defaultfalse
Live update (update())No — at creation only
Declared inpackages/dom/src/calendar.ts

A calendar windows what is off screen (virtualizeAbove) and caps “+N” (dayMaxLanes, eventMaxStack): a printout would miss events. With autoPrint: true, on the browser’s beforeprint the calendar draws everything (calendar.preparePrint()), and on afterprint puts its windows back. Without it, call preparePrint() yourself before window.print() and its returned function after — or use the Pro’s paged printing (@dzcalendar/pro/print).

It is read when the calendar is made.

import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris' });
// Without autoPrint: by hand around the print.
document.getElementById('print')!.addEventListener('click', () => {
const restore = calendar.preparePrint();
window.print();
restore();
});

It is read when the calendar is made: in Angular through the defaults (DZ_CALENDAR_DEFAULTS, provideDzCalendar), in React and Vue through initial.