From 67ec81babfde3942a9120182c87d74201fb83596 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 7 Aug 2018 08:19:52 -0400 Subject: [PATCH] FIX: fixes last backup/last_update dates (#6242) --- .../admin/controllers/admin-dashboard-next-general.js.es6 | 8 ++++++-- .../admin/templates/dashboard_next_general.hbs | 4 ++-- app/controllers/admin/dashboard_next_controller.rb | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 index 8a8af1bc2a4..7f81972a16b 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 @@ -84,12 +84,16 @@ export default Ember.Controller.extend(PeriodComputationMixin, { @computed("model.attributes.updated_at") updatedTimestamp(updatedAt) { - return moment(updatedAt).format("LLL"); + return moment(updatedAt) + .tz(moment.tz.guess()) + .format("LLL"); }, @computed("lastBackupTakenAt") backupTimestamp(lastBackupTakenAt) { - return moment(lastBackupTakenAt).format("LLL"); + return moment(lastBackupTakenAt) + .tz(moment.tz.guess()) + .format("LLL"); }, _reportsForPeriodURL(period) { diff --git a/app/assets/javascripts/admin/templates/dashboard_next_general.hbs b/app/assets/javascripts/admin/templates/dashboard_next_general.hbs index 76f1a342dac..21bde7bd178 100644 --- a/app/assets/javascripts/admin/templates/dashboard_next_general.hbs +++ b/app/assets/javascripts/admin/templates/dashboard_next_general.hbs @@ -138,8 +138,8 @@

{{i18n "admin.dashboard.last_updated"}}

{{updatedTimestamp}}

- {{i18n "admin.dashboard.whats_new_in_discourse"}} - + {{i18n "admin.dashboard.whats_new_in_discourse"}} + diff --git a/app/controllers/admin/dashboard_next_controller.rb b/app/controllers/admin/dashboard_next_controller.rb index ff2c6f71807..aaeb001a157 100644 --- a/app/controllers/admin/dashboard_next_controller.rb +++ b/app/controllers/admin/dashboard_next_controller.rb @@ -27,7 +27,7 @@ class Admin::DashboardNextController < Admin::AdminController private def last_backup_taken_at - if last_backup = Backup.all.last + if last_backup = Backup.all.first File.ctime(last_backup.path).utc end end