Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.toLocaleDateString() returns single digit values when used with { minute: "2-digit" } and { second: "2-digit" } #40141

Closed
altsep opened this issue Sep 18, 2021 · 0 comments
Labels
i18n-api Issues and PRs related to the i18n implementation.

Comments

@altsep
Copy link

altsep commented Sep 18, 2021

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.

@Mesteery Mesteery added the i18n-api Issues and PRs related to the i18n implementation. label Sep 18, 2021
@altsep 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
@altsep altsep closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

2 participants