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

Parse year + week of year #2113

Open
Vinze opened this issue Nov 4, 2022 · 2 comments
Open

Parse year + week of year #2113

Vinze opened this issue Nov 4, 2022 · 2 comments

Comments

@Vinze
Copy link

Vinze commented Nov 4, 2022

I'm trying to parse the week of year in the following format: 2022W44. I have included the customParseFormat, advancedFormat, isoWeek and weekOfYear plugins. See the following examples:

dayjs('2022W44', 'YYYY[W]WW'); // Expected: 2022-11-31, got: 2022-01-01
dayjs('2022W07', 'YYYY[W]WW'); // Expected: 2022-02-14, got: 2022-01-01

Did I forgot to include a plugin? Is the parse format invalid? Or did I just found a bug?

dayjs version 1.11.6

@felix0220170
Copy link

symbol 'W' is only used for formatting, can't be used for parsing.

dayjs().format('YYYY[W]WW'); //2022W44

@Vinze
Copy link
Author

Vinze commented Nov 8, 2022

So parsing of weeknumbers is not possible with dayjs at this moment?

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