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

Wrong week number displayed #692

Closed
HyacintheK opened this Issue Apr 12, 2018 · 4 comments

Comments

3 participants
@HyacintheK

HyacintheK commented Apr 12, 2018

Hello,

When the prop "showWeekNumbers" is equal to "true", the week numbers displayed are wrong.

For example, for the 12th april 2018, the week number displayed is "14" while we should see "15" (see here).

I made a sandbox with the behavior : https://codesandbox.io/s/xr4ovz55qo

image
image

Thanks in advance

@moag1000

This comment has been minimized.

moag1000 commented Apr 13, 2018

I was wondering why it didn't do the same thing in my live example. Finally found out why.

The link also says:
"Week number according to the ISO-8601 standard, weeks starting on Monday". If you do that (firstDayOfWeek={1} ), the week number shows up correctly.

edit: just to point out: I'm not telling you to change the first day of week. It's just an addition to say that US users are affected.

@gpbl

This comment has been minimized.

Owner

gpbl commented Apr 13, 2018

I'm not sure if this has something to do with the firstDayOfTheWeek.

For what I see after a quick debug, this line where we take week[0] (as the first day of the week row) gets the Jan. 1st from the previous year. It should instead get the first day of the week of the current year. This should be easily fixable...

@gpbl

This comment has been minimized.

Owner

gpbl commented Apr 13, 2018

mmm the above seems a different bug 🙄

gpbl added a commit that referenced this issue Apr 14, 2018

@gpbl gpbl closed this in #693 Apr 14, 2018

gpbl added a commit that referenced this issue Apr 14, 2018

Use last day of the week to get the week number (#693)
* Use last day of the week to get the week number

Fixes #692

* Fix unit test

* Fix rendering unit test
@gpbl

This comment has been minimized.

Owner

gpbl commented Apr 14, 2018

The fix has been published in v7.1.5. Please report back if you have some feedback, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment