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:
- Go to https://shahabyazdi.github.io/react-multi-date-picker/
- Select 'full year calendar' in Type
- Select 'enable' in Display week numbers
- 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

Desktop:
- OS: Ubuntu
- Browser Chrome
- Version 24.04
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
getWeekOfYearused the ISO week, but if the current calculation is needed for other calendars or use cases, perhaps adding an option touseISOWeekNumberwould work, as well, so that consumers of the library can choose.To Reproduce
Steps to reproduce the behavior:
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

Desktop: