feat(Calendar): add unselect event (#6198)

This commit is contained in:
neverland
2020-05-03 08:13:00 +08:00
committed by GitHub
parent 9a4927ac05
commit 8348819cc8
5 changed files with 33 additions and 4 deletions
+6 -2
View File
@@ -57,6 +57,10 @@ export function calcDateNum(date: [Date, Date]) {
return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
}
export function copyDate(dates: Date) {
return new Date(dates);
}
export function copyDates(dates: Date | Date[]) {
if (Array.isArray(dates)) {
return dates.map((date) => {
@@ -64,9 +68,9 @@ export function copyDates(dates: Date | Date[]) {
return date;
}
return new Date(date);
return copyDate(date);
});
}
return new Date(dates);
return copyDate(dates);
}