计算两个给定日期之间的天数
const days = (date, otherDate) => Math.ceil(Math.abs(date - otherDate) / (86400000)); result = days(new Date('2020-04-15'), new Date('2021-01-15')); console.log(result) -------------------------------------------------------- 275
计算两个给定日期之间的天数
const days = (date, otherDate) => Math.ceil(Math.abs(date - otherDate) / (86400000)); result = days(new Date('2020-04-15'), new Date('2021-01-15')); console.log(result) -------------------------------------------------------- 275