chronic icon indicating copy to clipboard operation
chronic copied to clipboard

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

Open bendangelo opened this issue 2 years ago • 3 comments

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'

bendangelo avatar Nov 14 '23 02:11 bendangelo

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

sriram0601 avatar Nov 25 '23 13:11 sriram0601

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.

bendangelo avatar Nov 27 '23 14:11 bendangelo