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 (#2789)
  • Loading branch information
oljc authored Nov 24, 2023
1 parent 62649b5 commit fb42186
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 fb42186

Please sign in to comment.