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/app/scripts/filters/taskOrderBy.js

22 lines
683 B
JavaScript

(function () {
'use strict';
angular.module("ariaNg").filter('taskOrderBy', ['orderByFilter', function (orderByFilter) {
return function (array, type) {
if (!angular.isArray(array)) {
return array;
}
if (type == 'name') {
return orderByFilter(array, ['taskName'], false);
} else if (type == 'percent') {
return orderByFilter(array, ['completePercent'], true);
} else if (type == 'remain') {
return orderByFilter(array, ['idle', 'remainTime'], false);
} else {
return array;
}
}
}]);
})();