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

weekOfYear shows wrong calender week at the turn of the year when using the "pt" locale #1344

Closed
MarinaFernandes opened this issue Jan 20, 2021 · 3 comments

Comments

@MarinaFernandes
Copy link
Contributor

Describe the bug
The 2020-12-31 should be calender week 53 but it shows as calender week 1.
(similar issue: #1264)

Expected behavior
https://runkit.com/marferna/6006c2f0e5d69000136b7ad0
We expected the example to output:
"With this date we are in week number: 53" and not 1;
"The current week is: 3" and not 4.

Information

  • Day.js Version 1.10.3
  • Browser Chrome 87.0.4280.141
@iamkun
Copy link
Owner

iamkun commented Jan 20, 2021

would you like to submit a PR to fix this? all we have to do is to add a 'yearStart: 4' to https://github.com/iamkun/dayjs/blob/dev/src/locale/pt.js

to indicate that

The week that contains Jan 4th is the first week of the year.

the same as https://github.com/iamkun/dayjs/blob/dev/src/locale/zh-cn.js

@MarinaFernandes
Copy link
Contributor Author

All right @iamkun,
I will submit the PR.
Thank you for the quick answer!

@iamkun
Copy link
Owner

iamkun commented Jan 20, 2021

fixed

@iamkun iamkun closed this as completed Jan 20, 2021
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