-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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() with option { hour: '2-digit' } returns single digit hour #30369
Labels
i18n-api
Issues and PRs related to the i18n implementation.
Comments
Looks like it was fixed https://chromium-review.googlesource.com/c/v8/v8/+/1529260 but only Node.js 12+ have the fix. Not sure how do we go about backporting these but it should be pretty easy to fix that I think. |
targos
added a commit
to targos/node
that referenced
this issue
Nov 12, 2019
Original commit message: [Intl] Fix output of hour:'2-digit', hour12: true Bug: chromium:527926 Change-Id: I783ba59c6e4b117163e058032fb04283e1f43c46 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529260 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#60379} Refs: v8/v8@fb63e5c Fixes: nodejs#30369
@lundibundi good find! Backport PR: #30372 |
BethGriggs
pushed a commit
that referenced
this issue
Dec 3, 2019
Original commit message: [Intl] Fix output of hour:'2-digit', hour12: true Bug: chromium:527926 Change-Id: I783ba59c6e4b117163e058032fb04283e1f43c46 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529260 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#60379} Refs: v8/v8@fb63e5c Fixes: #30369 Backport-PR-URL: #30372
MylesBorins
pushed a commit
that referenced
this issue
Dec 17, 2019
Original commit message: [Intl] Fix output of hour:'2-digit', hour12: true Bug: chromium:527926 Change-Id: I783ba59c6e4b117163e058032fb04283e1f43c46 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529260 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#60379} Refs: v8/v8@fb63e5c Fixes: #30369 Backport-PR-URL: #30372
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the passed in hour is single digit, i.e
1am -> 9am
1pm -> 9pm
The formatted hour is single digit, even though the hour option is set to a '2-digit' format.
The above code prints:
Date string: 11/11/2019 09:01:00
Formatted: Monday, November 11, 2019, 9:01 AM
Date string: 11/11/2019 18:05:00
Formatted: Monday, November 11, 2019, 6:05 PM
The formatting should return a '2-digit' hour:
Formatted: Monday, November 11, 2019, 09:01 AM
Formatted: Monday, November 11, 2019, 06:05 PM
Happy to help out, if you point me in the right direction. Thanks
The text was updated successfully, but these errors were encountered: