Just adding 7 doesn’t solve the problem.
The below function will give you the next day of the week.
function nextDay(x){
var now = new Date();
now.setDate(now.getDate() + (x+(7-now.getDay())) % 7);
return now;
}
Just adding 7 doesn’t solve the problem.
The below function will give you the next day of the week.
function nextDay(x){
var now = new Date();
now.setDate(now.getDate() + (x+(7-now.getDay())) % 7);
return now;
}