Skip to main content
The work days calendar is a PRO feature. See licensing and trial info.
The Calendar class lets you define which days and hours are working time. When a calendar is attached to the Gantt, task durations are measured in working hours/days and auto-scheduling skips non-working periods.

The calendar Prop

Create a Calendar instance and pass it to the <Gantt> component:

ICalendarConfig

The Calendar constructor accepts an optional configuration object:

Basic Example

Configure a standard Monday–Friday, 8-hours-per-day work week:

Calendar Interface

The Calendar instance exposes the following methods:

Setting Exceptions with setDayHours and setRangeHours

Use setDayHours to mark individual dates as non-working (e.g. public holidays) or to give them custom hours:

Custom Rules with addRule

For more complex schedules, add a rule function that receives a Date and returns the working hours for that day:
Rules added via addRule take precedence over weekHours. Individual day overrides set via setDayHours take precedence over both.

Using the Calendar with Auto-Scheduling

When a calendar and schedule are both active, all scheduling calculations (dependency propagation, duration measurement) use working time: