You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As in #30369, this occurs when getting data from new Date().toLocaleDateString(locale) with the aforementioned options. Additionally, hour option outputs two digits when { hour: "numeric", hour12: false } (it does not when hour12 is true).
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
{ minute: "2-digit" } or { second: "2-digit" } returning 2-digit values. { hour: "numeric" } returning numeric value when used along with { hour12: false }.
What do you see instead?
Same result as with "numeric" for minute and second. Two digits with "numeric" for hour.
Additional information
The former seems to be Chrome-specific, the latter I see in both Chrome 93.0.4577.82 and Firefox 93.0b6.
The text was updated successfully, but these errors were encountered:
altsep
changed the title
.toLocaleDateString() method options { minute: "2-digit" } and { second: "2-digit" } return single digit values
.toLocaleDateString() returns single digit values when used with { minute: "2-digit" } and { second: "2-digit" }
Mar 18, 2022
Version
v12.18.0
Platform
Microsoft Windows NT 10.0.18363.0 x64
Subsystem
No response
What steps will reproduce the bug?
As in #30369, this occurs when getting data from
new Date().toLocaleDateString(locale)
with the aforementioned options. Additionally, hour option outputs two digits when{ hour: "numeric", hour12: false }
(it does not when hour12 is true).How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
{ minute: "2-digit" }
or{ second: "2-digit" }
returning 2-digit values.{ hour: "numeric" }
returning numeric value when used along with{ hour12: false }
.What do you see instead?
Same result as with "numeric" for minute and second. Two digits with "numeric" for hour.
Additional information
The former seems to be Chrome-specific, the latter I see in both Chrome 93.0.4577.82 and Firefox 93.0b6.
The text was updated successfully, but these errors were encountered: