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

Polyfill: Hour cycle not correctly set when defaults are used #3065

Open
anba opened this issue Dec 13, 2024 · 0 comments
Open

Polyfill: Hour cycle not correctly set when defaults are used #3065

anba opened this issue Dec 13, 2024 · 0 comments

Comments

@anba
Copy link
Contributor

anba commented Dec 13, 2024

Test case:

console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hour12: false}));
console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hour12: true}));

console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hourCycle: "h23"}));
console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hourCycle: "h24"}));
console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hourCycle: "h11"}));
console.log(new Temporal.PlainDateTime(2020, 1, 1).toLocaleString("en", {hourCycle: "h12"}));

Actual:

1/1/2020, 12:00:00 AM
1/1/2020, 12:00:00 AM
1/1/2020, 12:00:00 AM
1/1/2020, 12:00:00 AM
1/1/2020, 12:00:00 AM
1/1/2020, 12:00:00 AM

Expected:

1/1/2020, 00:00:00
1/1/2020, 12:00:00 AM
1/1/2020, 00:00:00
1/1/2020, 24:00:00
1/1/2020, 0:00:00 AM
1/1/2020, 12:00:00 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant