getSubtaskDuration

calculates the combined duration of tasks nested in a project or another task.

number getSubtaskDuration( [string|number task_id] );
task_idstring|numberthe task's id, root_id will be used if not specified
numbertotal duration of nested tasks

Example

const formatter = gantt.ext.formatters.durationFormatter();
//duration of the whole project
let duration = gantt.getSubtaskDuration();
 
console.log(formatter.format(duration));
 
//duration of the subproject
duration = gantt.getSubtaskDates(1);
 
console.log(formatter.format(duration));

Details

Calculates the combined duration of tasks nested in a project or another task.

Tasks of the project type are not counted in the total duration.

The return value is calculated in duration units from the config.

See also
Back to top