initialDate
The date whose period the calendar shows first.
| Type | PlainDate |
|---|---|
| Default | today, in timeZone |
Live update (update()) | Yes, as date: update({ date: … }) |
| Declared in | packages/core/src/kernel.ts |
What it does
Section titled “What it does”The calendar opens on the period that holds this date: its month, its week,
its day. Left out, it is today in timeZone. Afterwards the person moves with
the header’s arrows and “today”, and your code with update({ date }) or
navigate('prev' | 'next' | 'today').
It is a Temporal.PlainDate — a date with no time and no zone, read as that
day in the calendar’s zone. Await loadTemporal() before making one: on a
browser without Temporal of its own, its polyfill arrives then.
Example
Section titled “Example”import { Temporal, loadTemporal } from '@dzcalendar/core';import { createCalendar } from '@dzcalendar/dom';
await loadTemporal();const calendar = createCalendar(element, { timeZone: 'Europe/Paris', initialDate: Temporal.PlainDate.from('2026-10-25'),});
// Later: another period.calendar.update({ date: Temporal.PlainDate.from('2026-12-01') });import { Component, signal } from '@angular/core';import { Temporal } from '@dzcalendar/core';import type { PlainDate } from '@dzcalendar/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: ` <dz-calendar timeZone="Europe/Paris" [(date)]="date" /> <p>Showing {{ date()?.toString() }}</p>`,})export class Agenda { // The first date; it follows the person's moves (two-way). readonly date = signal<PlainDate | undefined>(Temporal.PlainDate.from('2026-10-25'));}import { Temporal } from '@dzcalendar/core';import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" defaultDate={Temporal.PlainDate.from('2026-10-25')} />;}// Controlled instead: date={date} onDateChange={setDate}<script setup lang="ts">import { shallowRef } from 'vue';import { Temporal } from '@dzcalendar/core';import type { PlainDate } from '@dzcalendar/core';import { DzCalendar } from '@dzcalendar/vue';
const date = shallowRef<PlainDate>(Temporal.PlainDate.from('2026-10-25'));</script>
<template> <DzCalendar time-zone="Europe/Paris" v-model:date="date" /></template>In the frameworks it is the component’s date: Angular’s [(date)], React’s defaultDate (or date with onDateChange, controlled), Vue’s v-model:date.
Their Temporal.PlainDate.from(…) runs when the component does: on Safari,
await loadTemporal() once at startup first (Angular’s provideDzCalendar()
does it; React,
Vue).
Live demo
Section titled “Live demo”The calendar opens on the week of 25 October 2026 — Paris’s 25-hour day.
See also
Section titled “See also”initialView— the view it opens in.timeZone— the zone its “today” is read in.- Views.