feat(ui): format all dates to use ISO8601 (#117)

pull/118/head
Anthony Lapenna 2016-08-10 16:05:28 +12:00 committed by GitHub
parent 22122a27b5
commit 0e8fff7a51
5 changed files with 6 additions and 19 deletions

View File

@ -84,7 +84,7 @@
<tbody>
<tr>
<td>Created</td>
<td>{{ container.Created | date: 'medium' }}</td>
<td>{{ container.Created|getisodate }}</td>
</tr>
<tr>
<td>Path</td>
@ -186,7 +186,8 @@
<tbody>
<tr ng-repeat="(key, val) in container.State">
<td>{{key}}</td>
<td>{{ val }}</td>
<td ng-if="key === 'StartedAt' || key === 'FinishedAt'">{{val|getisodate}}</td>
<td ng-if="key !== 'StartedAt' && key !== 'FinishedAt'">{{val}}</td>
</tr>
</tbody>
</table>

View File

@ -50,7 +50,7 @@
</thead>
<tbody>
<tr ng-repeat="event in (events | filter:state.filter | orderBy:sortType:sortReverse)">
<td>{{ event.Time|getdatefromtimestamp }}</td>
<td>{{ event.Time|getisodatefromtimestamp }}</td>
<td>{{ event.Type }}</td>
<td>{{ event.Details }}</td>
</tr>

View File

@ -105,7 +105,7 @@
<span class="label label-primary image-tag" ng-repeat="tag in (image|repotags)">{{ tag }}</span>
</td>
<td>{{ image.VirtualSize|humansize }}</td>
<td>{{ image.Created|getdate }}</td>
<td>{{ image.Created|getisodatefromtimestamp }}</td>
</tr>
</tbody>
</table>

View File

@ -154,15 +154,7 @@ angular.module('uifordocker.filters', [])
return [];
};
})
.filter('getdate', function () {
'use strict';
return function (data) {
//Multiply by 1000 for the unix format
var date = new Date(data * 1000);
return date.toDateString();
};
})
.filter('getdatefromtimestamp', function () {
.filter('getisodatefromtimestamp', function () {
'use strict';
return function (timestamp) {
return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');

View File

@ -134,12 +134,6 @@ describe('filters', function () {
}));
});
describe('getdate', function () {
it('should convert the Docker date to a human readable form', inject(function (getdateFilter) {
expect(getdateFilter(1420424998)).toBe('Sun Jan 04 2015');
}));
});
describe('errorMsgFilter', function () {
it('should convert the $resource object to a string message',
inject(function (errorMsgFilter) {