Skip to content

messages

The calendar’s own words — its buttons, menus, announcements — over the locale’s.

TypePartial<DzMessages>
Defaultthe locale's words
Live update (update())Yes
Declared inpackages/dom/src/calendar.ts

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.

import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, {
timeZone: 'Europe/Paris',
messages: { today: 'This week', views: { timeGridWeek: 'Consultations', dayGridMonth: 'Overview' } },
});

In the frameworks it is an Angular input (messages) and a React and Vue prop (messages, messages).

“Today” becomes “This week”, and the views are named by the clinic.