wanasit / chrono

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

Chrono unable to parse "2005" or "3005" #296

Open hollowaysmith opened 5 years ago

hollowaysmith commented 5 years ago
> new Date("2005")
2005-01-01T00:00:00.000Z

> chrono.parseDate("2005")
null
gagan-bansal commented 5 years ago

As there is no valid date. Try like

> chrono.parseDate('2005-12-01')
2005-12-01T06:30:00.000Z
kilik52 commented 5 years ago

The problem is that even if we want to tell chrono to recognize 2005 as year by adding a custom parser, the result will still be discarded by refiner. So i was unable to find a way for chrono to parse 2005 at this moment.