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 cannot parse from gggg #784

Open
Vbubblery opened this issue Jan 22, 2020 · 2 comments
Open

Dayjs cannot parse from gggg #784

Vbubblery opened this issue Jan 22, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Vbubblery
Copy link

Vbubblery commented Jan 22, 2020

I want to parse a date: 2019W19 with dayjs:

dayjs("2019W19","gggg[W]ww")

It dose not support yet,
But moment supports it already.

moment("2019W19","gggg[W]ww")
@jzzfs
Copy link

jzzfs commented Oct 15, 2020

I had a use case for 2016-46 and solved it using

dayjs.utc("2016", "YYYY").startOf('isoWeek').add(46, 'weeks').toISOString()

EDIT

This approach fails for 2020-30. Here's my benchmark test suite and for the moment, momentjs still wins...

@iamkun iamkun added the enhancement New feature or request label Oct 16, 2020
@maxsimych
Copy link

Any workarounds for now? Any plans to fix that?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants