Skip to main content

unsetWorkTime

Description

Unsets a working time in the Gantt Chart

unsetWorkTime: (config: object) => void

Parameters

  • config - (required) object - the configuration object of a time span

Example

gantt.config.work_time = true;

// changes the working time of working days from ["8:00-17:00"] to ["9:00-18:00"]
gantt.setWorkTime({ hours: ["9:00-18:00"] });
// unsets the working time
gantt.unsetWorkTime({ hours: ["9:00-18:00"] });

Details

added in version 4.1

Configuration object properties

The configuration object can contain the following properties:

Property

Description

day a number of a week day [0 (Sunday) - 6 (Saturday)]. Note, you can set only 1 day at once
// unsets working hours for Mondays 
gantt.unsetWorkTime({ day: 1, hours: false });
date a specific date to set/unset working hours for
// unsets working hours for a specific date 
gantt.unsetWorkTime({
date: new Date(2025, 11, 1),
hours: false
});
hours an array of working hours as 'from'-'to' pairs.
'false' value unsets working hours, 'true' (default value) applies the default hours (["8:00-17:00"])
// unsets the working time for Fridays from 8:00 till 12:00
gantt.unsetWorkTime({ day : 5, hours : ["8:00-12:00"] });