My array:
urlArray = dataArray.map(function(item){
return {
Id: item.Id,
Title: item.Title,
StartDate: new Date(item.Start_x0020_Date).toLocaleDateString("en-GB"),
EndDate: new Date(item.End_x0020_Date).toLocaleDateString("en-GB"),
};
});
var nextYear = '01/01/2019';
How can I return return all items that have a start date that begins in this year (2018)? This is the same as excluding all items which have a start date > next year (i.e. 2019).
urlArray returns each date format as so:
1/1/1970
whereas in browser tools the API returns a date format of:
"2018-12-26T08:00:00Z"
I have tried returning all items with a filter that have a start date less than next year but still not working. My attempt is below:
let filteredAZLista = urlArray.filter(c => c.StartDate < nextYear);