Skip to content

Commit

Permalink
fix(date-picker): fix invalid date due to mismatch between date and f…
Browse files Browse the repository at this point in the history
…ormat
  • Loading branch information
oljc committed Nov 11, 2023
1 parent f540801 commit 10b12b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/web-vue/components/_utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ export function getDayjsValue(
if (isQuarter(format)) {
return dayjs(parseQuarterToMonth(value), format.replace(/\[Q]Q/, 'MM'));
}
return dayjs(value, format);

if (dayjs(value, format).isValid()) {
return dayjs(value, format);
}
}

return dayjs(value);
Expand Down

0 comments on commit 10b12b6

Please sign in to comment.