将一个时间段进行分割为每一天
function splitIntoDays(start ,end){
let days = [];
let currentDay = [];
while(currentDay <= end){
days.push(new Date(currentDay));
currentDay.setDate(currentDay.getDate() +1);
}
return days;
}
eg:
let start = new Date('2024-1-1');
let end = new Date('2024-1-1');
let days = splitIntoDays(start,end);