chronic
chronic copied to clipboard
Undefined method start for nil class
When i try to use Chronic.parse
on the following I get an error.
require 'chronic'
puts Chronic.parse '9 hours and 43 minutes ago'
Error:
/chronic/handlers.rb:517:in get_anchor': undefined method start=' for nil:NilClass (NoMethodError)
What could be causing the error?
@fearnowrath I think we don't have option like xx hours and xx minutes ago . Instead of this you can use xx hours before or xx minutes before. In your case you can use 583 minutes before. (9 hours and 43 minutes = 583 minutes)
Thanks but why does it throw an error rather than just returning nil? Is it possible to at least make that return nil? Also any plans on adding support for this kind of format in the future?
yeah, that is also a bug, and it should be pretty easy to add support for this format once #278 is finished
I have the same error
NoMethodError: undefined method start=' for nil:NilClass
If I just try to parse the character t
Chronic.parse("t")
Is there any updates?
I'm looking into solving this problem at the moment. Before I dig too deep into the code, I just wanted to see if there was any interest in resolving it or if we're fine with the workaround provided by @SagareGanesh.