mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 11:35:31 +02:00
add a filter to format runtime
This commit is contained in:
18
modules/core/client/filter/rumtime.client.filter.js
Normal file
18
modules/core/client/filter/rumtime.client.filter.js
Normal file
@@ -0,0 +1,18 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// Focus the element on page load
|
||||
// Unless the user is on a small device, because this could obscure the page with a keyboard
|
||||
|
||||
angular.module('core')
|
||||
.filter('runtime', runtime);
|
||||
|
||||
runtime.$inject = ['$translate'];
|
||||
|
||||
function runtime($translate) {
|
||||
return function (number) {
|
||||
if (number === 0 || isNaN(parseFloat(number)) || !isFinite(number)) return '-';
|
||||
return number + ' ' + $translate.instant('UNIT_MITUTE');
|
||||
};
|
||||
}
|
||||
}());
|
||||
Reference in New Issue
Block a user