I want to get the Monday list from the current week to the next five Mondays. I tried getting it for the current month. But if the date is the last of the month and it should give that Monday date and next five mondays date.
here is the code I tried.
var Mondays = [];
var month = new Date().getMonth();
while (d.getMonth() === month) {
mondays.push(new Date(d.getTime()));
d.setDate(d.getDate() + 7);
}
return mondays
the above will return the current month mondays. can someone help me out please.
Thanks in advance.