From 8a1f5d6bf4054e0c2d5b646b2a3aa955639d3920 Mon Sep 17 00:00:00 2001 From: stingl Date: Tue, 21 Sep 2021 09:53:23 +0200 Subject: [PATCH] extend method for past days --- js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 23fca2d..e255daa 100644 --- a/js/app.js +++ b/js/app.js @@ -438,12 +438,14 @@ const TimeTrack = { return 'https://' + finalPortalName + '.vemap.com'; }, - collectDataForDay() { + collectDataForDay(subtractDays = 0) { + let day = moment().subtract(subtractDays, "days").format("MMM Do YY"); let collection = []; this.tickets.forEach((ticket) => { ticket.history.forEach((historyEntry) => { - if (moment(historyEntry.trackingStarted).format("MMM Do YY") === moment().format("MMM Do YY")) { + if (moment(historyEntry.trackingStarted).format("MMM Do YY") === day) { + historyEntry.ticket = ticket.number; collection.push(historyEntry); } });