The tasks.businessDuration() method returns the business-only duration of the specified task. The duration is calculated from the current position of the task in the Gantt chart component, taking the defined business cells into account (see also onBeforeCellRender).
Declaration
DayPilot.Gantt.tasks.businessDuration(task)Parameters
task(DayPilot.Task, source data object, or id)
Return Value
DayPilot.Duration object
or
nullif the specified tasks doesn’t belong to the Gantt chart component
Example
const gantt = new DayPilot.Gantt("dp", {
// ...
});
gantt.init();
const duration = gantt.tasks.businessDuration(1);
console.log(duration);See Also
Skipping Non-Business Hours [doc.daypilot.org]
Business Hours [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot