Skip to content

Commit

Permalink
fix(dates): overdue on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 16, 2019
1 parent 808a740 commit 921e258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/helpers/hbs/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions src/public/js/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ define('pages/dashboard', [
html += '<td class="uk-width-1-10 uk-text-nowrap"><span class="uk-badge ticket-status-open uk-width-1-1">Open</span></td>';
html += '<td class="uk-width-6-10">' + ticket.subject + '</td>';
if (ticket.updated)
html += '<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">' + moment(ticket.updated).format(dashboardPage.shortDateFormat) + '</td>';
html += '<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">' + moment.utc(ticket.updated).tz(helpers.getTimezone()).format(dashboardPage.shortDateFormat) + '</td>';
else
html += '<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">' + moment(ticket.date).format(dashboardPage.shortDateFormat) + '</td>';
html += '<td class="uk-width-2-10 uk-text-right uk-text-muted uk-text-small">' + moment.utc(ticket.date).tz(helpers.getTimezone()).format(dashboardPage.shortDateFormat) + '</td>';
html += '</tr>';
});

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 921e258

Please sign in to comment.