Issue
I am passing a JSON string back from my Web Service and for some reason it is returning /Date(1461106800000+0100)/
.
I went the date to be returned in the format "yyyy-MM-dd"
I have been searching online and in my controller I have created a filter which looks like this:
app.filter("dateFilter", function () {
return function (item) {
if (item != null) {
return new Date(parseInt(item.substr(6)));
}
return "";
};
});
In my controller I have written this:
var bens = $filter('dateFilter')(ben.GetAllEventsByUserResult.HOLIDAY_START);
That returns this:
Conclusion
How can I get the date in the yyyy-MM-dd format?