autoPrint
Lets the browser’s print draw the whole calendar: everything mounted before, put back after.
| Type | boolean |
|---|---|
| Default | false |
Live update (update()) | No — at creation only |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”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.
Example
Section titled “Example”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();});import { Component } from '@angular/core';import { DZ_CALENDAR, DZ_CALENDAR_DEFAULTS } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], providers: [{ provide: DZ_CALENDAR_DEFAULTS, useValue: { autoPrint: true } }], template: `<dz-calendar timeZone="Europe/Paris" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" initial={{ autoPrint: true }} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" :initial="{ autoPrint: true }" /></template>It is read when the calendar is made: in Angular through the defaults (DZ_CALENDAR_DEFAULTS, provideDzCalendar), in React and Vue through initial.
See also
Section titled “See also”virtualizeAbove— what is windowed.dayMaxLanes— what “+N” hides.- Printing and exports.