[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:
Victor Woeltjen
2017-10-20 18:25:49 -07:00
committed by Pete Richards
parent 77c7bdfdec
commit 7442768ced
3 changed files with 32 additions and 13 deletions

View File

@ -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;