Time input using 24h does not change AM/PM
Categories
(Core :: Layout: Form Controls, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: brian, Assigned: av, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
Attachments
(2 files, 3 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
Steps to reproduce:
I have an <input type="time" value="01:00" /> field and my system is set to 12h time. The input displays "01:00 AM", as expected. If I type "16" into the hours field, it correctly updates to "04" (since 4pm is the equivalent of 16:00), but the meridiem remains at AM.
User Agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0"
Actual results:
I typed "16" into the hours field and the resulting display is "04:00 AM". It got the hour conversion right, but not the meridiem.
Expected results:
The meridiem should update to PM. Typing "16" into the hours field should result in a display of "04:00 PM".
Note: I wouldn't expect the reverse to happen. If the field is "02:00 PM" and I type "5", it shouldn't become 5am. But typing an hour value greater than 12 should trigger a meridiem shift.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
This is the relevant code: https://searchfox.org/mozilla-central/rev/a7d4b256719357f3f5cf89b30285d8a53f4e5d98/toolkit/content/widgets/datetimebox.js#1184-1197
That should presumably also call this.setDayPeriodValue(this.mPMIndicator)
.
I was made aware that bugs are auto-assigned once a patch is submitted, and it is not usually required to ask to be assigned to one. I will submit a proposed patch for this. I look forward to feedback on the code. Thanks.
Updated•3 years ago
|
Updated•2 years ago
|
Comment 7•2 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:av, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Comment 8•2 years ago
|
||
Patch is waiting on questions from me. Sorry!
Updated•2 years ago
|
Comment 9•2 years ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Comment 10•2 years ago
|
||
The contributor originally assigned to this bug expressed interest in continuing their patch
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2df8f5336e36 Time input using 24h does not change AM/PM. r=kpatenio,niklas,emilio
Comment 14•2 years ago
|
||
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/d213da5f7906 Follow-up: fix indentation of new tests. DONTBUILD
Comment 15•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2df8f5336e36
https://hg.mozilla.org/mozilla-central/rev/d213da5f7906
Description
•