scrollTime
The time of day a time grid is scrolled to when it is first shown.
| Type | DurationLike |
|---|---|
| Default | 'PT8H' |
Live update (update()) | Yes — the next time a time grid or a timeline is shown after another kind of view |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”A day has 24 hours and the screen shows a few: the grid opens scrolled to
this time, as a duration from midnight ('PT8H', { hours: 7, minutes: 30 }). With timeGrid: { slotMin }, the hours before it are not drawn and the
scroll counts from there.
It is applied when a time grid (or the Pro’s timeline) is shown: at first, and again when one comes back after another kind of view — a month, a list. Moving from a week to a day keeps where the person scrolled.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', scrollTime: { hours: 7, minutes: 30 } });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" [options]="{ scrollTime: 'PT7H' }" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" scrollTime="PT7H" />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" :options="{ scrollTime: 'PT7H' }" /></template>In Angular and Vue it goes in options; in React it is a prop.
Live demo
Section titled “Live demo”The week opens scrolled to 07:00.
See also
Section titled “See also”nowIndicator— the line at the current time.timeGrid— the hours drawn (slotMin, slotMax).initialView— the view it opens in.