wanasit / chrono

A natural language date parser in Javascript
MIT License
4.61k stars 340 forks source link

forwardDate doesn't work when there is a range of dates #505

Closed neoromantic closed 1 year ago

neoromantic commented 1 year ago

Specifically, I have this example:

chrono.ru.parse("С мая по ноябрь", new Date(), {forwardDate: true})

, which returns November of 2022 and May of 2023 instead of all dates be in 2023, as it should.

Same happens in English:

chrono.parse("From May to November", new Date(), {forwardDate: true})
wanasit commented 1 year ago

Thanks for reporting this. Fixed in 665bda6b7c308166e08dbf4acf7d8ce926e38be9.