titleFormat
How the header’s title is written: the platform’s date-format options, or a function.
| Type | TitleFormat — DateTimeFormatOptions | ((arg: TitleFormatArg) => string) |
|---|---|
| Default | the month, a week's days, a day in full |
Live update (update()) | Yes, as formats: update({ formats: … }) |
| Declared in | packages/core/src/kernel.ts |
What it does
Section titled “What it does”By default the title is the month (October 2026), a week’s days
(19 – 25 Oct 2026) or a day in full, in the calendar’s locale.
- Options of
Intl.DateTimeFormat({ month: 'long', year: 'numeric' }): a range is written when the first and last days differ. - A function
({ start, end, view, locale }) => string:startandendare the first and last days shown (PlainDates),viewis the view’s type.
titleFormat is read when the calendar is made. To change the title later,
update({ formats: { title } }) takes the same values — formats.title
wins over titleFormat when both are given.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', titleFormat: ({ start, view }) => (view === 'timeGridWeek' ? `Week of ${start.toLocaleString('en-GB', { day: 'numeric', month: 'long' })}` : start.toLocaleString('en-GB', { month: 'long', year: 'numeric' })),});
// Later: the title in another way.calendar.update({ formats: { title: { month: 'long', year: 'numeric' } } });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: { titleFormat: { month: 'long', year: 'numeric' } } }], template: `<dz-calendar timeZone="Europe/Paris" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" initial={{ titleFormat: { month: 'long', year: 'numeric' } }} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" :initial="{ titleFormat: { month: 'long', year: 'numeric' } }" /></template>titleFormat is read once, when the calendar is made: in Angular through the defaults (DZ_CALENDAR_DEFAULTS, provideDzCalendar), in React and Vue through initial — or, live, formats: { title } in each.
Live demo
Section titled “Live demo”The week’s title written by the application: the month in full and the year.
See also
Section titled “See also”locale— the language it is written in.formats— every other place’s writing.headerToolbar— where the title goes.