Use a for loop to calculate the weekdays between any two dates (remove Saturday and Sunday)

for(var i=first;i<=last,i+=24*3600*1000){
var d = new Date(i);
if(d.getDay() >= 1 && d.getDay() <= 5){
count++;
}
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325071762&siteId=291194637