Revert "In Images Overview, dates should be properly formatted"

This fails when the test is run in a non-UTC timezone.

This reverts commit 8baf0b8fcb.

Change-Id: Ib043a86d544f511c540f59f2b46f21ac7b05312d
This commit is contained in:
Richard Jones 2016-11-18 04:17:18 +00:00 committed by Rob Cresswell
parent e980382c7d
commit 84c238d35f
3 changed files with 8 additions and 8 deletions

View File

@ -50,12 +50,12 @@
* @ngdoc filter
* @name simpleDate
* @description
* Evaluates given iso date input as local timezone of the locale.
* Evaluates given for display as a short date, returning '-' if empty.
*/
function simpleDateFilter() {
simpleDateFilter.$inject = ['$filter'];
function simpleDateFilter($filter) {
return function (input) {
var d = new Date(input);
return d.toLocaleString(horizon.languageCode);
return $filter('noValue')($filter('date')(input, 'short'));
};
}

View File

@ -45,11 +45,11 @@
}));
it('returns blank if nothing', function () {
expect(simpleDateFilter()).toBe('Invalid Date');
expect(simpleDateFilter()).toBe('-');
});
it('returns the expected time', function() {
expect(simpleDateFilter('2016-06-24T04:19:07')).toBe('6/24/2016, 4:19:07 AM');
expect(simpleDateFilter('2016-06-24T04:19:07')).toBe('6/24/16 4:19 AM');
});
});

View File

@ -241,14 +241,14 @@
name: gettext('Name'),
owner: gettext('Owner'),
tags: gettext('Tags'),
updated_at: {label: gettext('Updated At'), filters: ['simpleDate']},
updated_at: gettext('Updated At'),
virtual_size: gettext('Virtual Size'),
visibility: gettext('Visibility'),
description: gettext('Description'),
architecture: gettext('Architecture'),
kernel_id: gettext('Kernel ID'),
ramdisk_id: gettext('Ramdisk ID'),
created_at: {label: gettext('Created At'), filters: ['simpleDate']},
created_at: gettext('Created At'),
container_format: { label: gettext('Container Format'), filters: ['uppercase'] },
disk_format: { label: gettext('Disk Format'), filters: ['noValue', 'uppercase'] },
is_public: { label: gettext('Is Public'), filters: ['yesno'] },