weekends
False leaves Saturday and Sunday out of every view.
| Type | boolean |
|---|---|
| Default | true |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”weekends: false is hiddenDays with 6 and 7 added: a week of five days, a
month of five columns. The two combine — weekends: false with
hiddenDays: [3] shows Monday, Tuesday, Thursday and Friday.
Saturday and Sunday here are ISO days 6 and 7, whatever the locale: where
the weekend falls on Friday and Saturday, hide [5, 6] with hiddenDays
instead.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', weekends: false });
// Later: the whole week.calendar.update({ weekends: true });import { Component, signal } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: ` <label><input type="checkbox" [checked]="weekends()" (change)="weekends.set(!weekends())" /> Weekends</label> <dz-calendar timeZone="Europe/Paris" [weekends]="weekends()" />`,})export class Agenda { readonly weekends = signal(false);}import { useState } from 'react';import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { const [weekends, setWeekends] = useState(false); return ( <> <label> <input type="checkbox" checked={weekends} onChange={() => setWeekends(!weekends)} /> Weekends </label> <DzCalendar timeZone="Europe/Paris" weekends={weekends} /> </> );}<script setup lang="ts">import { ref } from 'vue';import { DzCalendar } from '@dzcalendar/vue';
const weekends = ref(false);</script>
<template> <label><input v-model="weekends" type="checkbox" /> Weekends</label> <DzCalendar time-zone="Europe/Paris" :weekends="weekends" /></template>In the frameworks it is an input: Angular’s weekends, React’s weekends, Vue’s weekends.
Live demo
Section titled “Live demo”The week, Monday to Friday.
See also
Section titled “See also”hiddenDays— any weekday.businessHours— the hours of the days shown.firstDay— where the week starts.