Closed
Bug 1347069
Opened 7 years ago
Closed 7 years ago
[DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale
Categories
(Core :: Layout: Form Controls, enhancement)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: jessica, Assigned: jessica)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Hi zibi, do you know which API should we use to know whether a locale uses 12 or 24hr clock? Thanks.
Flags: needinfo?(gandalf)
Comment 2•7 years ago
|
||
Yep, use `(new Intl.DateTimeFormat('pl', {hour: 'numeric'})).resolvedOptions().hour12`
Flags: needinfo?(gandalf)
Assignee | ||
Comment 3•7 years ago
|
||
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #2) > Yep, use `(new Intl.DateTimeFormat('pl', {hour: > 'numeric'})).resolvedOptions().hour12` Cool! Thanks for the prompt reply.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jjong
Comment hidden (mozreview-request) |
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8847486 [details] Bug 1347069 - [DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale. https://reviewboard.mozilla.org/r/120470/#review123010 Stealing mconley's review. Looks good but I'd like to see this again before landing. ::: toolkit/content/widgets/datetimebox.xml:672 (Diff revision 1) > return { amString, pmString }; > ]]> > </body> > </method> > > + <method name="getHourFormatForLocale"> The method name here implies it returns some kind of format information when really it just returns true or false. Let's name it "is12HourTime" unless you have other suggestions? ::: toolkit/content/widgets/datetimebox.xml:676 (Diff revision 1) > > + <method name="getHourFormatForLocale"> > + <parameter name="aLocales"/> > + <body> > + <![CDATA[ > + this.log("getHourFormatForLocale: " + aLocales); Remove the logging before landing please
Attachment #8847486 -
Flags: review-
Assignee | ||
Comment 6•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8847486 [details] Bug 1347069 - [DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale. https://reviewboard.mozilla.org/r/120470/#review123010 > The method name here implies it returns some kind of format information when really it just returns true or false. Let's name it "is12HourTime" unless you have other suggestions? `is12HourTime` is good, thanks. > Remove the logging before landing please I have a debug flag, so the logging is not enabled by default. Do I still need to remove it?
Updated•7 years ago
|
Attachment #8847486 -
Flags: review?(mconley)
Comment 7•7 years ago
|
||
Clearing review flags, as Mossop has graciously stepped in to review this stuff (not only to help clear my review queue, but also to spread the knowledge of how the DateTime stuff works around!).
Assignee | ||
Comment 8•7 years ago
|
||
Thanks to Mike and Mossop! And ni? for comment 6.
Flags: needinfo?(dtownsend)
Comment 9•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8847486 [details] Bug 1347069 - [DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale. https://reviewboard.mozilla.org/r/120470/#review123010 > I have a debug flag, so the logging is not enabled by default. Do I still need to remove it? That's fine then, leave it in if you like.
Updated•7 years ago
|
Flags: needinfo?(dtownsend)
Comment hidden (mozreview-request) |
Comment 11•7 years ago
|
||
mozreview-review |
Comment on attachment 8847486 [details] Bug 1347069 - [DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale. https://reviewboard.mozilla.org/r/120470/#review124496 Looks good, thanks!
Attachment #8847486 -
Flags: review?(dtownsend) → review+
Assignee | ||
Comment 12•7 years ago
|
||
Thanks. https://treeherder.mozilla.org/#/jobs?repo=try&revision=1b83fe1d9a4db0546ffb5b3f24da52e239b9d129&group_state=expanded
Keywords: checkin-needed
Comment 13•7 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c8e3f323a687 [DateTimeInput] (l10n) 12/24hr format for <input type=time> based on locale. r=mossop
Keywords: checkin-needed
Comment 14•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c8e3f323a687
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment 15•5 years ago
|
||
Firefox 68.0.2. When i scroll time up, when hours are changing from 12 to 01 or back AM-PM stays the same. Also when minutes are changed 59<>01 hours does not change, but this is ok.
Also, in region where i live people does not understand what "AM" and "PM" mean, but Firefox for some reason is set to 12 hour format.
Comment 16•5 years ago
|
||
(In reply to Andrej from comment #15)
Firefox 68.0.2. When i scroll time up, when hours are changing from 12 to 01 or back AM-PM stays the same. Also when minutes are changed 59<>01 hours does not change, but this is ok.
Also, in region where i live people does not understand what "AM" and "PM" mean, but Firefox for some reason is set to 12 hour format.
Please file new bugs for issues you're seeing.
You need to log in
before you can comment on or make changes to this bug.
Description
•