Specifies whether Saturdays and Sundays count as business days in the Calendar.

Declaration

DayPilot.Calendar.businessWeekends

Default Value

false

Behavior

The default false treats weekends as non-business time. Set true to apply the normal daily business-hour range on weekends too. This classification is used by automatic timeline filtering and working-time event moving.

This property does not remove weekend columns from a Week view. Use viewType "WorkWeek" for weekday columns. To remove weekend time cells from a resource calendar's vertical axis, combine this property with showNonBusiness set to false.

These examples configure an existing DayPilot Pro Calendar. Keep its event data and other options.

JavaScript

const calendar = new DayPilot.Calendar("dp", {
  startDate: "2028-04-03",
  viewType: "Resources",
  days: 7,
  columns: [{id: "A", name: "Cedar room"}],
  scale: "Day",
  showNonBusiness: false,
  businessWeekends: false
});
calendar.init();

Angular

Add the configuration to an existing Calendar component.

<daypilot-calendar [config]="config"></daypilot-calendar>
import {DayPilot} from "daypilot-pro-angular";

config: DayPilot.CalendarConfig = {
  startDate: "2028-04-03",
  viewType: "Resources",
  days: 7,
  columns: [{id: "A", name: "Cedar room"}],
  scale: "Day",
  showNonBusiness: false,
  businessWeekends: false
};

React

import {DayPilot, DayPilotCalendar} from "daypilot-pro-react";

<DayPilotCalendar
  startDate="2028-04-03"
  viewType="Resources"
  days={7}
  columns={[{id: "A", name: "Cedar room"}]}
  scale="Day"
  showNonBusiness={false}
  businessWeekends={false}
/>

Vue

<script setup lang="ts">
import {DayPilot, DayPilotCalendar} from "daypilot-pro-vue";
const columns: NonNullable<DayPilot.CalendarConfig["columns"]> = [{id: "A", name: "Cedar room"}];
</script>

<template>
  <DayPilotCalendar
    startDate="2028-04-03"
    viewType="Resources"
    :days="7"
    :columns="columns"
    scale="Day"
    :showNonBusiness="false"
    :businessWeekends="false"
  />
</template>

See Also

Hiding Non-Business Time ยท DayPilot.Calendar Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript