I have the following filter which looks at two times, subtracts one from the other and if the figure is greater than 0 the filter passes
Here is the code
delayControllers.filter('customDelayFilter', function() {
return function(data) {
return data.filter(value => (new Date(value.etd) - new Date(value.std)) > 0);
};
});
in google console errors are thrown
Cannot read property 'filter' of undefined
in phpstorm the => shows an error as does the > symbol (expression expected)
Now here is the rub, this code works exactly as expected when run. I call it using
<tr ng-repeat="service in listOfServices | customDelayFilter">
I am only getting results where the row etd - std is greater than 0.. on ever device EXCEPT IOS. When i remove this filter the page works fine on IOS, so looks like Safari on IOS is being picky with the error
Is there a neater way to rewrite the above filter which was kindly supplied in a thread I raised some weeks ago (now closed)