messages
The calendar’s own words — its buttons, menus, announcements — over the locale’s.
| Type | Partial<DzMessages> |
|---|---|
| Default | the locale's words |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”Give any of them: today, previous, next, allDay, views (a label per
view, merged with the built-in ones), the menu’s entries, the screen
reader’s announcements… The others stay the locale’s: English and French
are built in, Arabic, Spanish and German one import each
(@dzcalendar/dom/locales/ar…). defineLocale(code, messages) registers a
whole language once for every calendar of the page. Dates and numbers are
not words: they are written by the platform in locale (and formats).
update({ messages }) replaces what an earlier messages gave.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', messages: { today: 'This week', views: { timeGridWeek: 'Consultations', dayGridMonth: 'Overview' } },});import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" [messages]="{ today: 'This week' }" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" messages={{ today: 'This week' }} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" :messages="{ today: 'This week' }" /></template>In the frameworks it is an Angular input (messages) and a React and Vue prop (messages, messages).
Live demo
Section titled “Live demo”“Today” becomes “This week”, and the views are named by the clinic.