js 获取两个时间之间日期
durationToDays(start, end) {
if (!start || !end) {
console.log('传入参数有误', start, end)
}
const startTime = new Date(start)
const endTime = new Date(end)
const dayCount = Math.ceil((Date.parse(endTime) - Date.parse(startTime)) / 86400000)
let dayList = []
for (let i = 0; i < dayCount; i ++) {
let tempDay = new Date(Date.parse(startTime) + 86400000 * i)
let tempDayStr = tempDay.toLocaleDateString()
dayList.push(tempDayStr)
}
return dayList
},