mojombo / chronic

Chronic is a pure Ruby natural language date parser.
http://injekt.github.com/chronic
MIT License
3.23k stars 452 forks source link

Chronic.parse "1 year, 7 months ago" breaks #415

Open bendangelo opened 8 months ago

bendangelo commented 8 months ago

Running that line gives this error:

[6] pry(main)> Chronic.parse "1 year, 7 months ago"
NoMethodError: undefined method `start=' for nil:NilClass
from /Users/ben/.rvm/gems/ruby-3.2.2/gems/chronic-0.10.2/lib/chronic/handlers.rb:517:in `get_anchor'
sriram0601 commented 8 months ago

This discussion may helps you #338, or what is your expected result?

bendangelo commented 7 months ago

Hi, thanks. I would expect something like this as the output:

Time.current - ChronicDuration.parse("1 year, 7 months ago")

Or at the very least it doesn't throw an error.