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

why dayjs('2024-12-31').locale('zh-cn').week() return 1 not 53 #2787

Open
lvqingxiang opened this issue Dec 16, 2024 · 2 comments
Open

why dayjs('2024-12-31').locale('zh-cn').week() return 1 not 53 #2787

lvqingxiang opened this issue Dec 16, 2024 · 2 comments

Comments

@lvqingxiang
Copy link

Describe the bug
A clear and concise description of what the bug is.

Expected behavior
A clear and concise description of what you expected to happen.

Information

  • "dayjs": "^1.11.13",
  • OS: mac
  • Browser [e.g. chrome 62]
  • Time zone: zh-cn
@Robert-Du0001
Copy link

I also just found the same issue.😂

@fanruinet
Copy link

This is by design.
dayjs.week() assumes January 1st is the first week of year. So 2024-12-31 belongs to week 1 of year 2025.

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

3 participants