multiMonthMaxColumns
How many months a multi-month view puts side by side, at most.
| Type | number |
|---|---|
| Default | 3 |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”The year view (multiMonthYear, import '@dzcalendar/dom/multimonth')
lays its months in a grid: as many columns as fit the width, up to this
number. 1 stacks them, one month under the other — a phone’s choice. A
month’s days are small: they show what fits, then “+N” (dayMaxLanes).
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';import '@dzcalendar/dom/multimonth';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', initialView: 'multiMonthYear', multiMonthMaxColumns: 2 });
// Later: one month under the other.calendar.update({ multiMonthMaxColumns: 1 });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';import '@dzcalendar/dom/multimonth';
@Component({ selector: 'app-year', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" view="multiMonthYear" [options]="{ multiMonthMaxColumns: 2 }" />`,})export class Year {}import { DzCalendar } from '@dzcalendar/react';import '@dzcalendar/dom/multimonth';
export function Year() { return <DzCalendar timeZone="Europe/Paris" defaultView="multiMonthYear" multiMonthMaxColumns={2} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';import '@dzcalendar/dom/multimonth';</script>
<template> <DzCalendar time-zone="Europe/Paris" view="multiMonthYear" :options="{ multiMonthMaxColumns: 2 }" /></template>In Angular and Vue it goes in options; in React it is a prop.
Live demo
Section titled “Live demo”The year, its months two by two.
See also
Section titled “See also”dayMaxLanes— a tiny day’s events.views— a multi-month view of your own (several months).initialView— opening on the year.