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

Week numbers are not using ISO week numbers #15

Open
dmtrek14 opened this issue Nov 12, 2024 · 0 comments
Open

Week numbers are not using ISO week numbers #15

dmtrek14 opened this issue Nov 12, 2024 · 0 comments

Comments

@dmtrek14
Copy link

Describe the bug
The getWeekOfYear function is simply counting the week number and not using ISO standard week number. This causes the incorrect week number to be shown when week numbers are displayed. For example, the last week of 2024 beginning on 30 December should be ISO week 1 of 2025 and not week 53 of 2024. Because of this, the week numbers for 2025 are off by one.

I believe this is the ultimate cause of an issue reported in react-multi-datepicker: shahabyazdi/react-multi-date-picker#321

It would be nice if the getWeekOfYear used the ISO week, but if the current calculation is needed for other calendars or use cases, perhaps adding an option to useISOWeekNumber would work, as well, so that consumers of the library can choose.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://shahabyazdi.github.io/react-multi-date-picker/
  2. Select 'full year calendar' in Type
  3. Select 'enable' in Display week numbers
  4. See '53' as the week number displayed next to the last week of 2024

Expected behavior
I expect '1' to show as the week number because that would be the correct ISO week number for the last week of December 2024/first week of January 2025.

Screenshots
image

Desktop:

  • OS: Ubuntu
  • Browser Chrome
  • Version 24.04
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