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

Isoweek bug when customParseFormat is active #2632

Open
Marouann opened this issue Apr 18, 2024 · 1 comment · May be fixed by #2650
Open

Isoweek bug when customParseFormat is active #2632

Marouann opened this issue Apr 18, 2024 · 1 comment · May be fixed by #2650

Comments

@Marouann
Copy link

Describe the bug
When I try to get the iso week number from a date, the isoWeek function is not correct.

Information
Bug has been reproduced in this sandbox

We get a very incoherent value :

  • dayjs.utc("2024-01-16T22:00:00.000Z").locale("fr").tz("Europe/Paris").isoWeek() return 3
  • dayjs.utc("2024-01-16T23:00:00.000Z").locale("fr").tz("Europe/Paris").isoWeek() return 2

That makes no sense, if A > B then A.isoWeek() >= B.isoWeek()

I don't really understand what is happening.

My guess is that when time is 23-23h59, the timezone makes the day change from 16 to 17 according to TZ. This day change leads to a decremented isoWeek.

I have tried to remove customParseFormat from used plugin and it started working. You can try it on the sandbox. However I need this plugin to make parse date in my TZ.

Thanks for your help.

@klm-turing
Copy link
Contributor

@Marouann This PR fix the incorrect behaviour of ISO week plugin.

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

Successfully merging a pull request may close this issue.

2 participants