Skip to content

Firefox: wrong yearOfWeek/weekOfYear for gregory calendar #53

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

Open
o-t-w opened this issue Jan 6, 2025 · 3 comments
Open

Firefox: wrong yearOfWeek/weekOfYear for gregory calendar #53

o-t-w opened this issue Jan 6, 2025 · 3 comments

Comments

@o-t-w
Copy link

o-t-w commented Jan 6, 2025

I am basing the correct behaviour based on how the Firefox implementation works.

For the ISO calendar, I would expect, and I get the following results:

const lastDay2029 = Temporal.PlainDate.from('2029-12-31');
console.log(lastDay2029.weekOfYear) // 1
console.log(lastDay2029.yearOfWeek) // 2030

Using the polyfill, I get the same results as those above when using the gregory calendar, whereas in Firefox I get:

const lastDay2029 = Temporal.PlainDate.from('2029-12-31[u-ca=gregory]');
console.log(lastDay2029.weekOfYear) // 53
console.log(lastDay2029.yearOfWeek) // 2029
@Sector6759
Copy link

Sector6759 commented Feb 24, 2025

I am basing the correct behaviour based on how the Firefox implementation works.

To me it appears that the Firefox implementation is wrong. December 31, 2029 is a monday, so its ISO week date is 2030-W01-1, as the majority of that week is in the gregorian year 2030. So the issue should be reported to Mozilla, not to @arshaw.

@arshaw
Copy link
Member

arshaw commented Feb 24, 2025

Both temporal-polyfill and the reference implementation give 1 2030, so it seems like Firefox has a bug as @Sector6759 says. We'd need to figure out the best place to file this with Mozilla.

@arshaw
Copy link
Member

arshaw commented Feb 24, 2025

I filed a bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=1950162

@arshaw arshaw changed the title wrong yearOfWeek/weekOfYear for gregory calendar Firefox: wrong yearOfWeek/weekOfYear for gregory calendar Feb 24, 2025
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

3 participants