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('2022-29th', 'YYYY-wo') get wrong result #1994

Open
honkinglin opened this issue Jul 20, 2022 · 1 comment
Open

dayjs('2022-29th', 'YYYY-wo') get wrong result #1994

honkinglin opened this issue Jul 20, 2022 · 1 comment

Comments

@honkinglin
Copy link

honkinglin commented Jul 20, 2022

Describe the bug
https://codesandbox.io/s/adoring-estrela-ptj5o1?file=/src/index.js
image

Expected behavior
期望解析 '2022-29th' 这类字符串能得到正常的数据

Information

  • Day.js Version [e.g. v1.0.0]
  • OS: [e.g. iOS]
  • Browser [e.g. chrome 62]
  • Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
@honkinglin honkinglin changed the title 当解析 '2022-29th' 时未得到正确的时间 dayjs('2022-29th', 'YYYY-wo') get wrong result Jul 20, 2022
@Bykiev
Copy link

Bykiev commented Jul 20, 2022

Hi, you should extend dayjs by CustomParseFormat plugin.
In second console.log input string with custom format cannot be parsed without specifying the format

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