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); } });