Cannot set two digit hour in keyboard mode
See original GitHub issueEnvironment
Tech | Version |
---|---|
@material-ui/pickers | 3.2.0 |
material-ui | 4.2.1 |
React | 16.8.6 |
Browser | Chrome |
Peer library | moment 2.24.0 |
Steps to reproduce
Using moment to get long date format for all locales. Try specifically for es
(Spain). Format for this locale is DD/MM/YYYY H:mm
.
Try to set any two digit hour using the keyboard mode.
Using mask to override format does not look robust enough for me… I would like to be able to provide locale format to component, being able to insert two digit hours for all of them.
Expected behavior
Setting 09:24 using keyboard mode should set 9:24. Setting 11:24 using keyboard mode should set 11:24
Actual behavior
Setting 09:24 using keyboard mode sets 9:24. Setting 11:24 using keyboard mode sets 1:12
When picking 11:24 using the UI selector, it works fine.
Live example
https://codesandbox.io/s/material-ui-pickers-usage-demo-0re4g
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to Bring Back the Keypad Entry in the Alarm Clock in iOS ...
Tap the hour or minute digit of the dial picker. A numpad should appear; use it to type in the time for the...
Read more >Keyboard typing weird letters and symbols - Apple Community
Keyboard typing weird letters and symbols. Hi all. I have tried to use my Macbook Pro this morning and when I type its...
Read more >DateTime Functions - Alteryx Help
Hour in 12 hour clock, 01 to 12. Up to 2 digits for hour, 1 to 12. Must follow with %p or %P....
Read more >Adjust keyboard settings on your Galaxy phone - Samsung
Use the toolbar on the keyboard · Keyboard settings · Type with your voice · Change the keyboard mode · Change the default...
Read more >Customizing date formats in Amazon QuickSight
Example Description Token
99 or 21 A 2‑digit representation of a year. YY
1999 or 2021 A full, 4‑digit numeric representation of a year. YYYY
1–12...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use HH selector. We need to know how much numbers will be in a mask. Or pass the
mask
explicitly__:__
I could’n deal with it neither in v3 via rifmFormatter, nor in v4. In v3 it’s really hard to use rifmFormatter, because it’s passes only formatted value, so it’s difficult to parse. Maybe someone have an example for it? In v4 mask just ignored for one-digit hour format, so input become unmasked. Am I missing something, or “Fixed in v4” is unmasked behaviour?
Thank you!