时间:2023-7-13 作者:网络剑客 分类: other
// 获取每一天
function dealDate(start,end){
let dateList = [];
var startTime = new Date(start);;
var endTime = new Date(end);;
while ((endTime.getTime() - startTime.getTime()) >= 0) {
var year = startTime.getFullYear();
var month = startTime.getMonth() + 1 < 10 ? '0' + (startTime.getMonth() + 1) : startTime.getMonth() + 1;
var day = startTime.getDate().toString().length == 1 ? "0" + startTime.getDate() : startTime.getDate();
// dateList.push(year + "/" + month + "/" + day);
dateList.push(month + "/" + day);
startTime.setDate(startTime.getDate() + 1);
}
return dateList;
}