Skip to content

timeGrid

The week and day views’ hours: which are drawn, how they are marked, and how a clock change is drawn.

TypeOmit<TimeGridOptions, 'displayZone' | 'businessHours' | 'availableSlots' | 'resources' | 'resourceGroups'>
Defaultnot set
Live update (update())Yes
Declared inpackages/core/src/kernel.ts

Merged key by key with update({ timeGrid }): give what changes, the rest stays; equal values change nothing.

  • slotMin, slotMax: the first hour drawn and the end of the last (an opening day of 08:00–18:00). Events entirely outside are not drawn — said once (events-not-drawn).
  • slotMinutes, labelMinutes: a tick every slotMinutes in the gutter, labelled every labelMinutes (a multiple of it). Only the labelled ticks show text; every tick carries data-time (a test, a hook, slotLane’s rows).
  • minEventMinutes: the shortest an event is drawn, so a five-minute call stays readable.
  • axis: 'wall' keeps every day’s rows aligned — on a clock change, the hour that does not exist is a band saying so, and the repeated hour is marked by a band (both readings share its rows); 'elapsed' draws real time to scale: the repeated hour appears twice and a 25-hour day is taller.

How tall an hour is comes from density (48, 72 or 96 px); the grid’s lines stay hourly. slotMinutes and labelMinutes must be whole minutes from 1 to 1440, and slotMin/slotMax must satisfy 0 ≤ slotMin < slotMax ≤ 24 h: anything else throws a RangeError at createCalendar or update(), before anything changes.

TypeAxisMode — "wall" | "elapsed"
Default'wall'
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

'wall' (the default): the rows aligned day to day, the skipped and the repeated hour marked by bands. 'elapsed': real time to scale — on Paris’s 25-hour day the repeated hour appears twice and the night is an hour taller.

Typenumber
Default60
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

A label every this many minutes of the clock; a multiple of slotMinutes lands on a tick.

Typenumber
Default15
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

The shortest an event is drawn: a shorter one is drawn this tall, its real time unchanged.

TypeDurationLike
Default'PT24H'
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

The end of the last hour drawn, as a duration from midnight, up to 24 hours ('PT18H', { hours: 18 }).

TypeDurationLike
Default'PT0H'
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

The first hour drawn, as a duration from midnight ('PT8H'); the hours before are not drawn and scrollTime counts from here.

Typenumber
Default60
Live update (update())Yes
Declared inpackages/core/src/views/timegrid.ts

A tick every this many minutes in the gutter: each carries data-time and gets its hooks.slotLabel and slotLane row; only the labelled ones show text. The grid’s lines stay hourly.

import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, {
timeZone: 'Europe/Paris',
timeGrid: { slotMin: 'PT8H', slotMax: 'PT18H', slotMinutes: 15, labelMinutes: 30 },
});
// Later: real time to scale, the rest unchanged.
calendar.update({ timeGrid: { axis: 'elapsed' } });

In Angular and Vue it goes in options (axis is also an Angular input and a Vue prop); in React it is a prop (and axis one of its own).

The day from 08:00 to 18:00, labelled every half hour (the 15-minute ticks carry no text).