From 427e98eb9417f030bfaf7571b5c829cfe3d5c92e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 4 Feb 2016 13:44:13 -0500 Subject: [PATCH] Display overdue tickets in red --- js/calendar/mods-for-hesk-calendar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/calendar/mods-for-hesk-calendar.js b/js/calendar/mods-for-hesk-calendar.js index c7b3d938..241e49b6 100644 --- a/js/calendar/mods-for-hesk-calendar.js +++ b/js/calendar/mods-for-hesk-calendar.js @@ -271,12 +271,18 @@ function removeFromCalendar(id) { function buildEvent(id, dbObject) { if (dbObject.type == 'TICKET') { + var endOfDay = moment(dbObject.startTime) + .set('hour', 23) + .set('minute', 59) + .set('second', 59) + .set('millisecond', 999); + return { title: dbObject.title, trackingId: dbObject.trackingId, start: moment(dbObject.startTime), url: dbObject.url, - color: 'green', + color: endOfDay.isBefore() ? '#dd0000' : 'green', allDay: true, type: dbObject.type };