weekNumbers
Shows each week’s number: at the start of a month’s rows, in a week view’s corner.
| Type | boolean |
|---|---|
| Default | false |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”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).
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', initialView: 'dayGridMonth', weekNumbers: true });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" view="dayGridMonth" [weekNumbers]="true" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" defaultView="dayGridMonth" weekNumbers />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" view="dayGridMonth" week-numbers /></template>In the frameworks it is an input: Angular’s weekNumbers, React’s weekNumbers, Vue’s week-numbers.
Live demo
Section titled “Live demo”The month, each row with its ISO week’s number.