前端日期小工具——持续更新中
计算日期之间间隔几周(支持跨年)
function weekCalculator(beginDate, endDate) {
//跳过第一周,直接获取第二周周一时间
const beginTime = beginDate.getTime() + (7 - this.getLocalDay(beginDate)) * (1000 * 60 * 60 * 24);
//计算到结束时间的天数
let day = (endDate.getTime() - beginTime) / (1000 * 60
原创
2020-12-25 11:22:51 ·
152 阅读 ·
0 评论