Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker throws error on 10.56.1 when date is invalid #4372

Closed
kimroen opened this issue Dec 6, 2024 · 0 comments · Fixed by #4396
Closed

DatePicker throws error on 10.56.1 when date is invalid #4372

kimroen opened this issue Dec 6, 2024 · 0 comments · Fixed by #4396
Labels
bug Something isn't working

Comments

@kimroen
Copy link
Contributor

kimroen commented Dec 6, 2024

💥 Regression Report

When using a DatePicker with minDate and correctInvalidDate enabled, the component throws an exception if the date passed in through the date prop is before the minDate.

The exception is: "Invalid time value", thrown by format from date-fns, as used by useDates in DatePickerProvider.

Example usage that fails:

<DatePicker
  date="2022-01-01"
  correctInvalidDate
  minDate={new Date()}
/>

Last working version

Worked up to version: 10.55.1

Stopped working in version: 10.56.0

To Reproduce

Steps to reproduce the behavior:

Here is a codesandbox rendering the latest version of Eufemia (10.59.0). It throws an error on render.

https://codesandbox.io/p/sandbox/gracious-waterfall-hc4shr

It's worth noting that on version 10.55.1 we see this in the console:

CleanShot 2024-12-06 at 14 35 00

Expected behavior

I expected the passed-in date to be corrected to today's date, or maybe be unset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants