From b19df6ed10090609f0f9c7d48d5017e95da44f5b Mon Sep 17 00:00:00 2001 From: stingl Date: Fri, 5 Nov 2021 11:43:14 +0100 Subject: [PATCH] merge minutes for pastDays; --- js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index eae48c3..ea26d65 100644 --- a/js/app.js +++ b/js/app.js @@ -488,7 +488,12 @@ const TimeTrack = { ticket.history.forEach((historyEntry) => { if (moment(historyEntry.trackingStarted).format("MMM Do YY") === day) { historyEntry.ticket = ticket.number; - collection.push(historyEntry); + + if (collection[ticket.number]) { + collection[ticket.number] += historyEntry.minutes; + } else { + collection[ticket.number] = historyEntry; + } } }); });