Skip to content

Commit 042b968

Browse files
committed
fix: Selecting more than one date in multi-dates throws an error (fixes #1173)
1 parent b6cf6ff commit 042b968

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/VueDatePicker/composables/useHelperFns.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ export const useHelperFns = () => {
140140

141141
if (!date) return isRange ? [fn[type](fallbackDate), fn[type](fallbackDate)] : fn[type](fallbackDate);
142142

143-
if (Array.isArray(date)) {
143+
if (Array.isArray(date) && isRange) {
144144
const start = date[0] ?? fallbackDate;
145145
const end = date[1] ?? fallbackDate;
146146
return [fn[type](start), fn[type](end)];
147147
}
148148

149-
return fn[type](date);
149+
return fn[type](date as Date);
150150
};
151151

152152
const setTimeModelValue = (

0 commit comments

Comments
 (0)