Forum Moderators: open
var businessDays = 0;
var maxDays = 30;
var today = new Date();
for(var n = 1; n < maxDays; n++){
thisdate = today + ( 1000 * 60 * 60 * 24 * n);
thisdateDay = thisdate.getDay();
if (thisdateDay >= 1 && thisdateDay <= 5){
businessDays++;
}
if(businessDays >= 6) continue;
}
alert(thisdateDay);
var today = new Date();
var businessDays = 0;
for (var n = 1; n < 30; n++) {
var thisdate = new Date(today.getTime() + (1000 * 60 * 60 * 24 * n) );
if (thisdate.getDay() >=1 && thisdate.getDay() <= 5) {
businessDays++;
}
if (businessDays >= 6) {
break;
}
}
alert (thisdate);