The implementation for a "time" input is unbalanced / inconsistent with regard to AM/PM
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
People
(Reporter: a-mar, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Steps to reproduce:
-
Create an html5 input field with type="time". This effect can even be observed on the MDN page: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#technical_summary
-
Select any time in the AM
-
Scroll the hours digits with arrow keys. Either up or down, will give the same result.
-
When the hours hit 12 (from either direction) the time will be forcefully switched from AM to PM. This makes some sense when going up in digits, from 11am to 12pm. But it also works in the opposite direction, so that 1:01am minus an hour will become 12:01pm.
-
Repeat the same experiment, starting with a PM time. The am/pm flip will not occur.
Actual results:
11am + 1 hr = 12pm.
1am - 1 hr = 12pm
11pm + 1 hr = 12pm
1pm - 1 hr = 12pm
Expected results:
Consistency. The AM/PM should always flip across that noon / midnight border. (This appears to be how Chromium operates.) Or it should never flip and be left to the user's manual specification. But AM and PM should behave similarly and it should never flip at the 1am border.
(While you're at it, Chromium also built in a picker wheel to this field that would be nice to have. But that's an enhancement request. This is a bug report.)
Updated•8 months ago
|
Comment 1•7 months ago
|
||
Thanks for the bug report!
(While you're at it, Chromium also built in a picker wheel to this field that would be nice to have. But that's an enhancement request. This is a bug report.)
Firefox's time picker interface is behind the pref dom.forms.datetime.timepicker, and still needs some polish before shipping.
Description
•