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] Dynamic inputFormat not working as expected #6584

Closed
2 tasks done
elkebab opened this issue Oct 21, 2022 · 2 comments
Closed
2 tasks done

[DatePicker] Dynamic inputFormat not working as expected #6584

elkebab opened this issue Oct 21, 2022 · 2 comments
Assignees
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition feature: Mask editing Will be removed once we have the new field components.

Comments

@elkebab
Copy link
Contributor

elkebab commented Oct 21, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When inputFormat is changed from dd.MM.yyyy to yyyy the displayed value is ddMM (date and month) instead of year.

Expected behavior 🤔

When inputFormat is changed from dd.MM.yyyy to yyyy the displayed value should be the year of the date value.

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/amazing-antonelli-mjzri5?file=/demo.tsx

Steps:

  1. Click the "Only year" checkbox
  2. The displayed value is 0101 instead of 2022

Context 🔦

No response

Your environment 🌎

No response

Order ID 💳 (optional)

No response

@elkebab elkebab added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 21, 2022
@zannager zannager added component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition labels Oct 21, 2022
@flaviendelangle flaviendelangle added the feature: Mask editing Will be removed once we have the new field components. label Oct 21, 2022
@alexfauquette
Copy link
Member

alexfauquette commented Oct 24, 2022

Just open a PR to fix this. Notice that those mask inputs will be replaced by fields in v6

@alexfauquette alexfauquette self-assigned this Oct 24, 2022
@alexfauquette alexfauquette added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 24, 2022
@alexfauquette
Copy link
Member

Fixed by #6617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition feature: Mask editing Will be removed once we have the new field components.
Projects
None yet
Development

No branches or pull requests

4 participants