Skip to content

weekNumbers

Shows each week’s number: at the start of a month’s rows, in a week view’s corner.

Typeboolean
Defaultfalse
Live update (update())Yes
Declared inpackages/dom/src/calendar.ts

Weeks are numbered by the locale’s rules, or by firstDay when it is given with the locale’s minimal days: ISO weeks (Monday, a first week holding 4 days) in most of Europe, Sunday weeks where the first week holds 1 January in the United States. A date before week 1 belongs to the previous year’s last week.

The number’s look is the application’s through hooks.weekNumber (a link to the week, a different label).

import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', initialView: 'dayGridMonth', weekNumbers: true });

In the frameworks it is an input: Angular’s weekNumbers, React’s weekNumbers, Vue’s week-numbers.

The month, each row with its ISO week’s number.

  • firstDay — the week’s first day.
  • locale — the rules come from it.
  • hooks — the number’s own look (hooks.weekNumber).