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

feat(Field.Date): show error messages on invalid date #4508

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joakbjerk
Copy link
Contributor

@joakbjerk joakbjerk commented Jan 28, 2025

WIP

We have decided to go for removing the strict input control, and allow for user to input invalid dates, and extending the returnObject to contain the invalid dates, so we can allow for error messaging when an invalid date is given. This is to make the component less confusing for users, and it will remove code complexity on our side. Field.Date will be updated to show error messages by default when an invalid date is given, and invalid dates will be corrected to closes valid date, only when correctInvalidDates is enabled.

relies on groundwork from #4469

TODO

  • Add invalidDate property DatePicker returnObject
  • Add date validation to Field.Date
  • Add tests
  • Add docs

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 1:44pm

@joakbjerk joakbjerk changed the title fix(DatePicker): update inputs to not allow invalid dates fix(DatePicker): update inputs to not allow invalid dates (WIP) Jan 28, 2025
Copy link

codesandbox-ci bot commented Jan 28, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@joakbjerk joakbjerk marked this pull request as ready for review January 28, 2025 14:11
@joakbjerk joakbjerk requested review from tujoworker and langz January 28, 2025 14:11
@langz langz changed the title fix(DatePicker): update inputs to not allow invalid dates (WIP) fix(DatePicker): inputs should not allow invalid dates (WIP) Jan 29, 2025
@joakbjerk joakbjerk marked this pull request as draft February 6, 2025 13:57
@joakbjerk joakbjerk changed the title fix(DatePicker): inputs should not allow invalid dates (WIP) fix(DatePicker): show error messages on invalid date (WIP) Feb 10, 2025
@joakbjerk joakbjerk changed the title fix(DatePicker): show error messages on invalid date (WIP) feat(Field.Date): show error messages on invalid date Feb 17, 2025
@joakbjerk joakbjerk force-pushed the fix/datepicker-do-not-allow-invalid-date branch from 5541fe4 to ae60a7d Compare February 17, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant