From 921e258721e4d383cbd46646154ab9d68d84b78f Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Wed, 16 Jan 2019 01:36:10 -0500 Subject: [PATCH] fix(dates): overdue on dashboard --- src/helpers/hbs/helpers.js | 2 +- src/public/js/pages/dashboard.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers/hbs/helpers.js b/src/helpers/hbs/helpers.js index 20257bc1b..2fd819279 100644 --- a/src/helpers/hbs/helpers.js +++ b/src/helpers/hbs/helpers.js @@ -22,7 +22,7 @@ // node_modules var _ = require('lodash'); var moment = require('moment-timezone'); -require('moment-duration-format'); +require('moment-duration-format')(moment); // The module to be exported var helpers = { diff --git a/src/public/js/pages/dashboard.js b/src/public/js/pages/dashboard.js index 514378b14..a2005a642 100644 --- a/src/public/js/pages/dashboard.js +++ b/src/public/js/pages/dashboard.js @@ -71,9 +71,9 @@ define('pages/dashboard', [ html += 'Open'; html += '' + ticket.subject + ''; if (ticket.updated) - html += '' + moment(ticket.updated).format(dashboardPage.shortDateFormat) + ''; + html += '' + moment.utc(ticket.updated).tz(helpers.getTimezone()).format(dashboardPage.shortDateFormat) + ''; else - html += '' + moment(ticket.date).format(dashboardPage.shortDateFormat) + ''; + html += '' + moment.utc(ticket.date).tz(helpers.getTimezone()).format(dashboardPage.shortDateFormat) + ''; html += ''; }); @@ -105,7 +105,7 @@ define('pages/dashboard', [ var lastUpdated = $('#lastUpdated').find('span'); var formatString = helpers.getLongDateFormat() + ' ' + helpers.getTimeFormat(); - var formated = moment(_data.lastUpdated, 'MM/DD/YYYY hh:mm:ssa').format(formatString); + var formated = moment.utc(_data.lastUpdated, 'MM/DD/YYYY hh:mm:ssa').tz(helpers.getTimezone()).format(formatString); lastUpdated.text(formated); if (!_data.data) {