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

PlainDate.yearOfWeek and PlainDate.weekOfYear not adhering to the standard #27

Closed
wundersolutions-juanjo opened this issue Feb 5, 2024 · 1 comment

Comments

@wundersolutions-juanjo
Copy link

First things first, I'm not a 100% certain of this one, but I think both fields are using a sunday-saturday week instead of the ISO 8601 Monday-Sunday weeks, resulting in wrong week days for edge cases like 2021-01-03.

https://myweb.ecu.edu/mccartyr/isowdcal.html shows said date as being inside 2020-W53, but the following snippet returns '2021-W1' instead

date = Temporal.PlainDate.from('2020-01-03');
console.log(`${date.yearOfWeek}-W${date.weekOfYear}`); // => Should be '2020-W53'

Might be related to #26

@arshaw
Copy link
Member

arshaw commented Feb 6, 2024

Fixed. See this comment: #26 (comment)

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

2 participants