forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdate.js
24 lines (23 loc) · 805 Bytes
/
date.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';
angular.module('openshiftConsole')
.directive("relativeTimestamp", function() {
return {
restrict: 'E',
scope: {
timestamp: '=',
dropSuffix: '=?'
},
template: '<span data-timestamp="{{timestamp}}" data-drop-suffix="{{dropSuffix}}" class="timestamp" title="{{timestamp | date : \'short\'}}">{{timestamp | dateRelative : dropSuffix}}</span>'
};
})
.directive("durationUntilNow", function() {
return {
restrict: 'E',
scope: {
timestamp: '=',
omitSingle: '=?',
precision: '=?'
},
template: '<span data-timestamp="{{timestamp}}" data-omit-single="{{omitSingle}}" data-precision="{{precision}}" class="duration">{{timestamp | duration : null : omitSingle : precision}}</span>'
};
});