Get the next 7 days date
const dateArray = [];
for (let i = 0; i < 7; i++) {
const date = new Date(Date.now() + i * 24 * 60 * 60 * 1000);
const year = date.getFullYear();
const month = date.getMonth() + 1 < 10 ? `0${
date.getMonth() + 1}` : date.getMonth() + 1;
const day = date.getDate() < 10 ? `0${
date.getDate()}` : date.getDate();
dateArray.push(`${
year}-${
month}-${
day}`);
}
console.log(dateArray);