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

dayjs returns wrong object when created using year week string YYYY-w #999

Open
albert-cai opened this issue Aug 11, 2020 · 2 comments
Open

Comments

@albert-cai
Copy link

albert-cai commented Aug 11, 2020

Describe the bug
When creating dayjs object from year week string such as 2020-35, the created object contains the wrong month and date information.

For example:

dayjs('2020-35', 'YYYY-w'). //Wed Jan 01 2020 00:00:00
dayjs('2020-35', 'YYYY-w').format('YYYY-w'). //2020-1

Expected behavior
dayjs should return the right object.

Information

  • Day.js Version 1.8.33
  • OS: macos
  • Browser chrome84
  • Time zone: GMT+08:00
@iamkun
Copy link
Owner

iamkun commented Aug 11, 2020

Day.js does not support parsing w token but will add it in the future.

List of all available parsing tokens https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens

@PengJiyuan
Copy link

any progress?

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