修改日历时间
This commit is contained in:
@@ -292,4 +292,20 @@ export const calculateDuration = (startTime: string, endTime: string): string =>
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const getOneMonth = (): Date[] => {
|
||||
const dates: Date[] = [];
|
||||
const currentDate = dayjs();
|
||||
const nextMonth = dayjs().add(1, 'month');
|
||||
|
||||
// 从当前日期开始,遍历到下个月的同一天
|
||||
let date = currentDate;
|
||||
while (date.isBefore(nextMonth) || date.isSame(nextMonth, 'day')) {
|
||||
dates.push(date.toDate());
|
||||
date = date.add(1, 'day');
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
Reference in New Issue
Block a user