This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues/pull-requests.
AriaNg/src/scripts/filters/dateDuration.js

12 lines
368 B
JavaScript
Raw Normal View History

2016-05-13 18:09:12 +02:00
(function () {
'use strict';
2016-06-11 12:52:40 +02:00
angular.module('ariaNg').filter('dateDuration', ['moment', function (moment) {
2016-05-13 18:09:12 +02:00
return function (duration, sourceUnit, format) {
var timespan = moment.duration(duration, sourceUnit);
var time = moment.utc(timespan.asMilliseconds());
return time.format(format);
2016-12-10 18:50:25 +01:00
};
2016-05-13 18:09:12 +02:00
}]);
2016-08-01 16:49:16 +02:00
}());