diff --git a/dispatcher/static/table.js b/dispatcher/static/table.js index 3c046c4..c58609a 100644 --- a/dispatcher/static/table.js +++ b/dispatcher/static/table.js @@ -216,17 +216,20 @@ class Table { let projects = parent.projects.map(project => { let durations = Array(this.nDays).fill("") + let total = 0 project.tasks.forEach(task => { let date = new Date(task.date) let i = Math.floor((date.valueOf() - this.startDate.valueOf()) / DAY_MS) let hours = task.duration / 60 durations[i] = hours + total += hours parentDurations[i] += hours }) return { id: project.id, name: project.name, - durations: durations + durations: durations, + total: total } }) @@ -239,7 +242,7 @@ class Table { parent.is_productive ) - projects.forEach(project => { + projects.filter(p => p.total !== 0).forEach(project => { this.addProject(project.id, project.name, "", project.durations) }) })