How to filter inside ng-repeater something filtered by custom filter
I have custom filter:
errorReporter.filter('customDateFilter', function () {
return function (input) {
var input1 = parseInt(input.substring(6)); //da makne onaj /Date početak
var jsDate = new Date(input1);
var day = jsDate.getDate();
var month = jsDate.getMonth();
var year = jsDate.getFullYear();
return day.toString() + "." + (month + 1).toString() + "." + year.toString();
};
});
I also have :
{{error.TimeUtc | customDateFilter}}
And somewhere I have filter input :
Problem is that with input I filter TimeUtc and not TimeUtc | customDateFilter.
Example, I have TimeUtc /Date/5869454458/, and TimeUtc | customDateFilter returns 12.07.2014. If I type 2014 inside input it does not filter. If I type 5869 I get row filtered.
UPDATE: I made this filter:
errorReporter.filter('SearchTimeUtcFilter', function () {
return function (input) {
var input1 = parseInt(input.substring(6)); //da makne onaj /Date početak
var jsDate = new Date(input1);
var day = jsDate.getDate();
var month = jsDate.getMonth();
var year = jsDate.getFullYear();
var datum = day.toString() + "." + (month + 1).toString() + "." + year.toString();
$log.info("why doesn't log?");
if (datum.indexOf($scope.SearchTimeUtc) > -1)
return true;
return false;
}
});
and inside ng-repeat:
Still nothing
Privacy & Cookie Consent
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.