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

Invalid date when parsing MMMM, YYYY format #1452

Closed
MrPoketes opened this issue Apr 12, 2021 · 2 comments
Closed

Invalid date when parsing MMMM, YYYY format #1452

MrPoketes opened this issue Apr 12, 2021 · 2 comments
Labels
☢️Bug Something isn't working

Comments

@MrPoketes
Copy link

MrPoketes commented Apr 12, 2021

Describe the bug
Parsing does not working for MMMM, YYYY format even after extending customParseFormat.

Expected behavior
A clear and concise description of what you expected to happen.
Doing dayjs("April, 2021", "MMMM, YYYY") should return a normal date. However it returns Invalid Date

Information

  • v1.10.4
  • OS: unrelated
  • Browser: unrelated
  • Time zone: unrelated

EDIT:
Here is the sandbox example of this bug.
https://codesandbox.io/s/dayjs-bug-4djm6?file=/src/App.tsx

@iamkun iamkun added the ☢️Bug Something isn't working label Jun 10, 2021
@iamkun
Copy link
Owner

iamkun commented Jun 10, 2021

Bug confirmed, error matching April, instead of April

@BePo65
Copy link
Contributor

BePo65 commented May 31, 2022

The problem is the comma in the date / format string; dayjs cannot handle this. PR #1913 should fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants