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(datepicker): Enable custom date-formats #3415

Merged
merged 5 commits into from
May 3, 2024

Conversation

yusijs
Copy link
Contributor

@yusijs yusijs commented May 2, 2024

This pr fixes a bug where innerValue is used if value is null. innerValue should only be used if defaultValue is set (most likely need better logic here). Resolves #3414

Also implements a way to format the segments when they are not focused, to avoid 04/06/2024 being confusing based on user language/locale setup. This is not the solution requested, but the one that both allows for accessibility to be maintained, and allows for custom formatting. Resolves #3405

@yusijs yusijs force-pushed the RHENRI/date-picker-custom-format branch from 106b99f to 0684520 Compare May 3, 2024 09:24
@yusijs yusijs marked this pull request as ready for review May 3, 2024 09:24
fix(datepicker): Handle external null-values
@yusijs yusijs force-pushed the RHENRI/date-picker-custom-format branch from 0684520 to 509e165 Compare May 3, 2024 09:25
Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@torleifhalseth torleifhalseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how the formatting of the input works from a UX perspective, but other than that I like that it is based on Intl.DateTimeFormat 👍

Added a small comment about the useEffect that we could describe in code.

@yusijs
Copy link
Contributor Author

yusijs commented May 3, 2024

@torleifhalseth there is a short video in the issue here -> #3405 (comment)

Agree on adding a note on the effect 👍

@yusijs yusijs merged commit 2f91ed9 into develop May 3, 2024
6 checks passed
@yusijs yusijs deleted the RHENRI/date-picker-custom-format branch May 3, 2024 12:18
mhwaage pushed a commit to mhwaage/design-system that referenced this pull request Jul 29, 2024
* feat(datepicker): Enable custom date-formats

* fix(datepicker): Handle external null-values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants