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

Unable to parse date in russian format #898

Closed
akaSybe opened this issue May 10, 2020 · 3 comments
Closed

Unable to parse date in russian format #898

akaSybe opened this issue May 10, 2020 · 3 comments
Labels
☢️Bug Something isn't working

Comments

@akaSybe
Copy link

akaSybe commented May 10, 2020

Describe the bug

Dayjs can't parse date in russian format

https://codesandbox.io/s/dayjs-parse-russian-date-error-wv2wh

Expected behavior

Should correctly parse date and return valid dayjs object. Moment.js works correctly

Information

  • Day.js Version: 1.8.26
  • OS: MacOS
  • Browser: 81.0.4044.138
  • Time zone: Moscow
@iamkun iamkun added the ☢️Bug Something isn't working label May 10, 2020
@iamkun
Copy link
Owner

iamkun commented May 11, 2020

Hi, is '08 мая 2020' , '08 май 2020' both valid string in ru?

This bug is caused by two different month strings. https://github.com/iamkun/dayjs/blob/dev/src/locale/ru.js#L4

@akaSybe
Copy link
Author

akaSybe commented May 11, 2020

'май' is a nominative case and 'мая' is a genitive case.

'08 мая 2020' is the most common date form as I know.

But anyway, looks like dayjs right now doesn't parse both '08 мая 2020' and '08 май 2020'

I could help you with PR

@iamkun
Copy link
Owner

iamkun commented May 14, 2020

Fixed in #908

@iamkun iamkun closed this as completed May 14, 2020
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

2 participants