getSubtaskDuration

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

number getSubtaskDuration( [string|number task_id] );

Parameters

task_idstring|numberthe task's id, root_id will be used if not specified

Returns

numbertotal duration of nested tasks

Example

//duration of the whole project
var duration = gantt.getSubtaskDuration();
 
console.log(duration + gantt.config.duration_unit + "s");
 
//duration of the subproject
var duration = gantt.getSubtaskDates(1);
 
console.log(duration + gantt.config.duration_unit + "s");

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