I have an array that contains date objects.
But the data is too large to parse everything. I want to filter results by date range (eg: between 10 days ago to the 10 days). So far, I can only filter with a single date.
Here's my code. I just don't how to go about achieving that.
var today = new Date();
var d = today.getDay();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = yyyy + '-' + mm + '-' + dd;
var eventParsed = JSON.parse(eventsObjects).filter(({
date
}) => date === today);
console.log(eventParsed);