question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set two digit hour in keyboard mode

See original GitHub issue

Environment

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dmtrKovalenkocommented, Aug 27, 2019

Use HH selector. We need to know how much numbers will be in a mask. Or pass the mask explicitly __:__

0reactions
NZainchkovskiycommented, Mar 31, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found