AMBARI-7501. Ambari Web absolute/exact date time string follow local timezone.(xiwang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a539800a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a539800a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a539800a Branch: refs/heads/branch-alerts-dev Commit: a539800a65c56427fabac41d1f92664e3671d677 Parents: 89f3a2c Author: Xi Wang <[email protected]> Authored: Thu Sep 25 15:49:37 2014 -0700 Committer: Xi Wang <[email protected]> Committed: Thu Sep 25 16:51:33 2014 -0700 ---------------------------------------------------------------------- ambari-web/app/utils/date.js | 6 +++--- .../app/views/main/dashboard/widgets/uptime_text_widget.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a539800a/ambari-web/app/utils/date.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/date.js b/ambari-web/app/utils/date.js index 887fdda..671ec02 100644 --- a/ambari-web/app/utils/date.js +++ b/ambari-web/app/utils/date.js @@ -60,7 +60,7 @@ module.exports = { } format = format || 'ddd, MMM DD, YYYY HH:mm'; - return moment((new Date(timestamp)).toISOString().replace('Z', '')).format(format); + return moment((new Date(timestamp))).format(format); }, /** @@ -75,8 +75,8 @@ module.exports = { return timestamp; } var format = 'ddd MMM DD YYYY'; - var date = moment((new Date(timestamp)).toISOString().replace('Z', '')).format(format); - var today = moment((new Date()).toISOString().replace('Z', '')).format(format); + var date = moment((new Date(timestamp))).format(format); + var today = moment((new Date())).format(format); if (date === today) { return 'Today ' + (new Date(timestamp)).toLocaleTimeString(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/a539800a/ambari-web/app/views/main/dashboard/widgets/uptime_text_widget.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/dashboard/widgets/uptime_text_widget.js b/ambari-web/app/views/main/dashboard/widgets/uptime_text_widget.js index 3d9ed34..be3c962 100644 --- a/ambari-web/app/views/main/dashboard/widgets/uptime_text_widget.js +++ b/ambari-web/app/views/main/dashboard/widgets/uptime_text_widget.js @@ -54,7 +54,7 @@ App.UptimeTextDashboardWidgetView = App.TextDashboardWidgetView.extend({ }.property('data'), timeConverter: function (timestamp) { - var m = moment((new Date(timestamp)).toISOString().replace('Z', '')); + var m = moment((new Date(timestamp))); return [m.format('ddd MMM DD YYYY'), m.format('HH:mm:ss')]; },
