getWorkdayCount(start, end) {
let workdayCount = 0;
let noWorkdayCount = 0;
for (let date = start; date <= end; date.setDate(date.getDate() + 1)) {
if (date.getDay() >= 1 && date.getDay() <= 5) {
workdayCount++;
} else {
noWorkdayCount++;
}
}
return [workdayCount, noWorkdayCount];
},
计算两个日期之间的工作日和休息日天数
最新推荐文章于 2024-08-27 15:59:21 发布