DayPilot.Gantt.tasks.businessDuration

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 null if 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]

DayPilot.Gantt Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript