diff options
| author | Alexander Filippov <a.filippov@yadro.com> | 2018-11-16 16:26:04 +0300 |
|---|---|---|
| committer | Gunnar Mills <gmills@us.ibm.com> | 2018-12-07 18:18:56 +0000 |
| commit | dbf048119670aabcdff6c35fe6873f0ac7555a69 (patch) | |
| tree | ff2ad25c001f3b98c19a773b32d250bebfe56362 /app/server-health | |
| parent | bd500cd2d6841a7d0a7d69bdccfc5d46026380a8 (diff) | |
| download | phosphor-webui-dbf048119670aabcdff6c35fe6873f0ac7555a69.tar.gz phosphor-webui-dbf048119670aabcdff6c35fe6873f0ac7555a69.zip | |
fix date/time representation in national locales
Added "localeDate" filter to present date and time in preferred format:
- the date will be displayed as: 'Dec 3, 2018'
- the time will be displayed in locale preferred format.
- the timezone will be displayed as abbrev or GMT+/-offset.
At the 'Date and Time setting' the time zone name will displayed in long
format if it is possible.
All text parts of date/time representation will be in English.
Resolves: openbmc/phosphor-webui#42
Change-Id: I2fdbb47c62dfc5000039b0c00a20f64a9a389fc6
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Diffstat (limited to 'app/server-health')
| -rw-r--r-- | app/server-health/controllers/log-controller.html | 4 | ||||
| -rw-r--r-- | app/server-health/controllers/log-controller.js | 11 |
2 files changed, 5 insertions, 10 deletions
diff --git a/app/server-health/controllers/log-controller.html b/app/server-health/controllers/log-controller.html index 7aadc11..f3f9e89 100644 --- a/app/server-health/controllers/log-controller.html +++ b/app/server-health/controllers/log-controller.html @@ -8,11 +8,11 @@ <h2 class="inline h4">All events from the BMC</h2> <div class="event-log__timezone inline float-right"> <button class="dropdown__button" ng-click="timezone = timezone == true ? false : true;" toggle-flag="timezone"> - <span>{{tmz === 'UTC'? 'UTC Timezone' : 'User Timezone'}}</span> + <span>{{tmz === 'UTC' ? 'UTC Timezone' : 'User Timezone'}}</span> </button> <ul class="dropdown__list inline" ng-show="timezone"> <li> - <button ng-click="selectUserTimezone();">User Timezone</button> + <button ng-click="tmz = ''">User Timezone</button> </li> <li> <button ng-click="tmz = 'UTC'">UTC Timezone</button> diff --git a/app/server-health/controllers/log-controller.js b/app/server-health/controllers/log-controller.js index 0303854..a604126 100644 --- a/app/server-health/controllers/log-controller.js +++ b/app/server-health/controllers/log-controller.js @@ -69,7 +69,6 @@ window.angular && (function(angular) { dataService.updateServerHealth(result.data); $scope.logs = result.data; $scope.originalData = result.original; - $scope.selectUserTimezone(); $scope.loading = false; }); }; @@ -102,9 +101,9 @@ window.angular && (function(angular) { } if ($scope.start_date && endDate) { - var date = new Date($filter('date')( - log.Timestamp, 'MM/dd/yyyy HH:mm:ss', $scope.tmz)); - return (date >= $scope.start_date && date <= endDate); + return ( + log.Timestamp >= $scope.start_date && + log.Timestamp <= endDate); } else { return true; } @@ -160,10 +159,6 @@ window.angular && (function(angular) { $scope.export_data = JSON.stringify(data); } - $scope.selectUserTimezone = function() { - $scope.tmz = new Date().toString().match(/\(([A-Za-z\s].*)\)/)[1]; - }; - $scope.accept = function() { APIUtils.deleteLogs($scope.selectedEvents).then(function() { $scope.confirm = false; |

