export function getWeek(date1, date2) { let d1 = new Date(date1); let d2 = new Date(date2); console.log(Math.ceil(parseInt(((d2 - d1) / (1000 * 3600 * 24)) / 7)) + 1); //两个时间相差的周数 }View Code
标签:date1,date2,相差,周数,JavaScript,d2,d1 From: https://www.cnblogs.com/bi-hu/p/16802599.html