fix total estimate calculation

This commit is contained in:
Johannes Millan 2017-01-29 03:08:03 +01:00
parent 146ab0ccde
commit 1464ea5165

View file

@ -87,7 +87,13 @@
if (angular.isArray(tasks) && tasks.length > 0) {
totalEstimate = moment.duration();
_.each(tasks, (task) => {
totalEstimate.add(task.timeEstimate);
if (task.subTasks && task.subTasks.length > 0) {
_.each(task.subTasks, (subTask) => {
totalEstimate.add(subTask.timeEstimate);
});
} else {
totalEstimate.add(task.timeEstimate);
}
});
}
return totalEstimate;