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

Parsing is improved when adding a space #517

Open
oodavid opened this issue Jun 19, 2023 · 0 comments
Open

Parsing is improved when adding a space #517

oodavid opened this issue Jun 19, 2023 · 0 comments

Comments

@oodavid
Copy link

oodavid commented Jun 19, 2023

I've observed that:

  • chrono.parse('jan') returns undefined
  • chrono.parse('jan ') returns a Date

This seems to be limited to months. I wonder if it's a word boundary issue?

chrono.parseDate("jan"); // undefined
chrono.parseDate("jan "); // Date

Out of curiosity, I tried a few other short values.
I'm not sure what I'd expect 2020 to return, maybe Jan 1st 2020? Not sure TBH

chrono.parseDate("2020"); // undefined
chrono.parseDate("2020 "); // undefined
chrono.parseDate("mon"); // Date
chrono.parseDate("mon "); // Date
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

1 participant