date filter changes service

This commit is contained in:
gandhimathi 2018-05-26 12:31:21 +05:30
parent faa85990e0
commit 45122988b5

View File

@ -169,4 +169,19 @@ app.filter('ucfirst', function() {
return function(input) {
return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : '';
}
});
/*
* service for session date
* filter
* */
app.service('dateListDescService', function() {
this.getOrderByList = function(list) {
var listDetails = list.sort(function(a, b) {
a = new Date(a.givenDateObject);
b = new Date(b.givenDateObject);
return a >b ? -1 : a < b ? 1 : 0;
});
return listDetails;
}
});