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/overview/controllers | |
| 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/overview/controllers')
| -rw-r--r-- | app/overview/controllers/system-overview-controller.html | 4 | ||||
| -rw-r--r-- | app/overview/controllers/system-overview-controller.js | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/app/overview/controllers/system-overview-controller.html b/app/overview/controllers/system-overview-controller.html index a548675..e9e189c 100644 --- a/app/overview/controllers/system-overview-controller.html +++ b/app/overview/controllers/system-overview-controller.html @@ -85,7 +85,7 @@ </a> <div class="quick-links__item no-icon"> <p class="inline quick-links__label">BMC time</p> - <p class="inline courier-bold float-right bmc-time">{{(bmc_time | date:'medium') + ' ' + tmz}}</p> + <p class="inline courier-bold float-right bmc-time">{{ bmc_time | localeDate }}</p> </div> <div class="quick-links__item no-icon"> <p class="inline quick-links__label">Turn <span ng-if="dataService.LED_state == 'off'">on</span><span ng-if="dataService.LED_state == 'on'">off</span> server LED</p> @@ -125,7 +125,7 @@ <p class="inline event__id">#{{event.Id}}</p> <p class="inline event__priority high-priority">High</p> <p class="inline event__severity high-priority">{{event.severity_code}}</p> - <p class="inline event__timestamp">{{(event.Timestamp | date:'medium') + ' ' + tmz}}</p> + <p class="inline event__timestamp">{{ event.Timestamp | localeDate }}</p> <div> <p class="inline event__description">{{getEventLogTitle(event)}}</p> </div> diff --git a/app/overview/controllers/system-overview-controller.js b/app/overview/controllers/system-overview-controller.js index 6393ebc..0b7d2f0 100644 --- a/app/overview/controllers/system-overview-controller.js +++ b/app/overview/controllers/system-overview-controller.js @@ -14,7 +14,6 @@ window.angular && (function(angular) { function($scope, $window, APIUtils, dataService, Constants, $q) { $scope.dataService = dataService; $scope.dropdown_selected = false; - $scope.tmz = getUserTimezone(); $scope.logs = []; $scope.server_info = {}; $scope.bmc_firmware = ''; @@ -159,9 +158,6 @@ window.angular && (function(angular) { } return title; }; - function getUserTimezone() { - return new Date().toString().match(/\(([A-Za-z\s].*)\)/)[1]; - } } ]); })(angular); |

