firstDay
The day weeks start on, as an ISO weekday: 1 is Monday, 7 is Sunday.
| Type | Weekday — 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|
| Default | the locale's first day of the week |
Live update (update()) | Yes |
| Declared in | packages/core/src/kernel.ts |
What it does
Section titled “What it does”It decides where a week view starts, the first column of a month, and how weeks are numbered. Left out, it is the locale’s: Monday in most of Europe, Sunday in the United States, Saturday in much of the Arabic-speaking world.
The numbers are ISO weekdays, as everywhere in DzCalendar (hiddenDays,
businessHours): 1 Monday … 7 Sunday — not the 0-to-6 of JavaScript’s Date.
update({ firstDay: null }) goes back to the locale’s.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'America/New_York', initialView: 'dayGridMonth', firstDay: 7 });
// Later: back to the locale's.calendar.update({ firstDay: null });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="America/New_York" view="dayGridMonth" [options]="{ firstDay: 7 }" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="America/New_York" defaultView="dayGridMonth" firstDay={7} />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="America/New_York" view="dayGridMonth" :options="{ firstDay: 7 }" /></template>In Angular and Vue it goes in options; in React it is a prop.
Live demo
Section titled “Live demo”The month, its weeks starting on Sunday (7).
See also
Section titled “See also”locale— the default comes from it.weekNumbers— numbered by these rules.hiddenDays— the same ISO weekdays.