Lets say my current date is 'May 9' , now i wish to get 7 consecutives events(dates) after 'May 9'. Here's my json array sample
[{
"date": "4 Mar",
"day": "Mon",
"holiday_name": "bbb"
},
{
"date": "7 Mar",
"day": "Thu",
"holiday_name": "ccc"
},
{
"date": "8 Mar",
"day": "Fri",
"holiday_name": "ddd"
},
{
"date": "5 Apr",
"day": "Fri",
"holiday_name": "eee"
},
{
"date": "14 Apr",
"day": "Sun",
"holiday_name": "fff"
},
{
"date": "14 Apr",
"day": "Sun",
"holiday_name": "gfgg"
},
{
"date": "24 Apr",
"day": "Wed",
"holiday_name": "ttt"
}, ...
//more in the list]
I get the current date with this,
let day = date.getDate();
const monthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
let month = monthNames[date.getMonth()];
let appendDate = day + " " + month;