Highlighting Business Hours using CSS

Business hours cells are marked with *_cell_business class

javascript scheduler component business hours css

Customizing the Business Hours

You can set the daily business hours using businessBeginsHour and businessEndsHour properties.

JavaScript example

<div id="dp"></div>

<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  // ...
  dp.businessBeginsHour = 8;
  dp.businessEndsHour = 20;
  dp.init();
</script>

Weekends are non-business by default. You can change it using businessWeekends property.

JavaScript example:

<div id="dp"></div>

<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  // ...
  dp.businessWeekends = true;
  dp.init();
</script>

You can also set the business status for each grid cell individually using onBeforeCellRender event handler:

<div id="dp"></div>

<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  // ...
  dp.onBeforeCellRender = function(args) {
    if (args.cell.resource === "A") {
      var hour = args.cell.start.getHours();
      if (10 <= hour && hour < 15) {
        args.cell.business = true;
      }
      else {
        args.cell.business = false;
      }
    }
  };
  dp.init();
</script>

Hiding Non-Business Hours

You can hide non-business hours using the showNonBusiness property. See also hiding non-business hours.

Tutorials

API: businessBeginsHour, businessEndsHour, businessWeekends.

The examples mark 8 AM to 6 PM on weekdays as business time. They display an hourly timeline and leave non-business hours visible.

The framework examples use DayPilot Pro. For installation, see the Angular, React or Vue Scheduler guide.

Angular

import {Component} from "@angular/core";
import {DayPilot, DayPilotModule} from "daypilot-pro-angular";

@Component({
  selector: "app-scheduler-example",
  standalone: true,
  imports: [DayPilotModule],
  template: `
    
    <daypilot-scheduler [config]="config"></daypilot-scheduler>
  `
})
export class SchedulerExampleComponent {
  config: DayPilot.SchedulerConfig = {
    startDate: "2026-11-03",
    days: 1,
    scale: "Hour",
    timeHeaders: [{groupBy: "Day"}, {groupBy: "Hour"}],
    resources: [{id: "A", name: "Room A"}, {id: "B", name: "Room B"}],
    events: [{id: 1, text: "Planning", resource: "A", start: "2026-11-03T09:00:00", end: "2026-11-03T12:00:00"}],
    businessBeginsHour: 8,
    businessEndsHour: 18,
    businessWeekends: false
  };

}

React

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

export default function SchedulerExample() {

  return <div>

    <DayPilotScheduler
      startDate={"2026-11-03"}
      days={1}
      scale={"Hour"}
      timeHeaders={[{groupBy: "Day"}, {groupBy: "Hour"}]}
      resources={[{id: "A", name: "Room A"}, {id: "B", name: "Room B"}]}
      events={[{id: 1, text: "Planning", resource: "A", start: "2026-11-03T09:00:00", end: "2026-11-03T12:00:00"}]}
      businessBeginsHour={8}
      businessEndsHour={18}
      businessWeekends={false}
    />
  </div>;
}

Vue

<script setup>
import {DayPilot, DayPilotScheduler} from "daypilot-pro-vue";

const startDate = "2026-11-03";
const days = 1;
const scale = "Hour";
const timeHeaders = [{groupBy: "Day"}, {groupBy: "Hour"}];
const resources = [{id: "A", name: "Room A"}, {id: "B", name: "Room B"}];
const events = [{id: 1, text: "Planning", resource: "A", start: "2026-11-03T09:00:00", end: "2026-11-03T12:00:00"}];
const businessBeginsHour = 8;
const businessEndsHour = 18;
const businessWeekends = false;

</script>

<template>
  <div>

    <DayPilotScheduler
      :startDate="startDate"
      :days="days"
      :scale="scale"
      :timeHeaders="timeHeaders"
      :resources="resources"
      :events="events"
      :businessBeginsHour="businessBeginsHour"
      :businessEndsHour="businessEndsHour"
      :businessWeekends="businessWeekends"
    />
  </div>
</template>

Availability

Availability of this feature in DayPilot editions:

ProductLitePro
DayPilot for JavaScript
DayPilot for ASP.NET WebForms
DayPilot for ASP.NET MVC
DayPilot for Java