mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 00:23:01 +00:00
[List] Use standard format for modified/persisted times (#1737)
* [List] Use standard format for modified/persisted times This provides consistency with other times and dates in the user interface, and also provides a meaningful sort order due to the use of ISO formats for standard date/time presentation. Fixes #1730. * Remove unused dependency
This commit is contained in:
committed by
Pete Richards
parent
77c7bdfdec
commit
7442768ced
@ -21,7 +21,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define(function () {
|
||||
function ListViewController($scope) {
|
||||
function ListViewController($scope, formatService) {
|
||||
this.$scope = $scope;
|
||||
$scope.orderByField = 'title';
|
||||
$scope.reverseSort = false;
|
||||
@ -30,6 +30,8 @@ define(function () {
|
||||
var unlisten = $scope.domainObject.getCapability('mutation')
|
||||
.listen(this.updateView.bind(this));
|
||||
|
||||
this.utc = formatService.getFormat('utc');
|
||||
|
||||
$scope.$on('$destroy', function () {
|
||||
unlisten();
|
||||
});
|
||||
@ -50,17 +52,13 @@ define(function () {
|
||||
icon: child.getCapability('type').getCssClass(),
|
||||
title: child.getModel().name,
|
||||
type: child.getCapability('type').getName(),
|
||||
persisted: new Date(
|
||||
child.getModel().persisted
|
||||
).toUTCString(),
|
||||
modified: new Date(
|
||||
child.getModel().modified
|
||||
).toUTCString(),
|
||||
persisted: this.utc.format(child.getModel().persisted),
|
||||
modified: this.utc.format(child.getModel().modified),
|
||||
asDomainObject: child,
|
||||
location: child.getCapability('location'),
|
||||
action: child.getCapability('action')
|
||||
};
|
||||
});
|
||||
}, this);
|
||||
};
|
||||
|
||||
return ListViewController;
|
||||
|
Reference in New Issue
Block a user