// 日期
const formatGsDate = (dateStr: string) => {
const date = new Date(dateStr);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
}
const getDatesBetween = (startDate: any, endDate: any) => {
const dates = [];
const current = new Date(startDate);
window.console.log('1111111111111111current <= endDate')
window.console.log(current,endDate)
while(current <= endDate) {
window.console.log('current <= endDate')
window.console.log(current,endDate)
window.console.log(new Date(current))
dates.push(formatGsDate(new Date(current)));
current.setDate(current.getDate() + 1);
}
return dates;
};
const changeDateRange = () =>{
window.console.log('pdate1')
window.console.log(pdate1)
const starTime: any = pdate1.value[0]
const endTime: any = pdate1.value[1]
window.console.log(getDatesBetween(starTime,endTime))
};