wanasit / chrono

A natural language date parser in Javascript
MIT License
4.6k stars 341 forks source link

[BUG] Month and day not recognized #557

Closed Dushusir closed 3 months ago

Dushusir commented 4 months ago

Steps to reproduce

parseDate('06-17 13:00')

Expected results

like Mon Jun 17 2024 13:00:00 GMT+0800

Actual results

Recognize as current date Fri Jun 28 2024 13:00:00 GMT+0800

Dushusir commented 4 months ago

Second Problem: The string 59:01.01 cannot be parsed as a date, but Excel can

wanasit commented 3 months ago

Thanks for reporting this.

However, after consideration, I don't think we should include such cases in the library.

I don't think a hyphenated number pair (e.g. "06-17") is a common date format. The more common pattern using slash (e.g. "06/17") has already been supported.

For the Excel case, 59:01.01, I honestly am not sure what would be the expected output. The fact that Excel can parse it doesn't mean it is common and expected behavior for Chrono users.

--

I suggest adding a custom parser if it is needed for your use-case.