chronic icon indicating copy to clipboard operation
chronic copied to clipboard

NoMethodError instead of returning nil

Open bellowsj opened this issue 12 years ago • 3 comments

I expect to get nil when I try to run: a = Chronic.parse("T") but instead it blows up and I get: NoMethodError: undefined method `start=' for nil:NilClass

Thanks, Jason

bellowsj avatar Nov 19 '13 00:11 bellowsj

The same for me for "2011 May 09 to 2011 June 28" with 0.10.2

Chronic.parse('2011 May 09 to 2011 June 28') => NoMethodError: undefined method `+' for nil:NilClass

gobert avatar Nov 27 '13 14:11 gobert

Chronic.parse("T") this is bug, it should return nil not throw exception.

Chronic.parse('2011 May 09 to 2011 June 28') this is just unsupported, but still it shouldn't raise exception. It's unsupported firstly because Chronic parses only discrete times not intervals. Secondly such format 2011 June 28 isn't implemented at all.

davispuh avatar Nov 27 '13 16:11 davispuh

this bug fixed by https://github.com/mojombo/chronic/pull/243 commit maybe we can close this issue

saiqulhaq avatar Jan 10 '18 10:01 saiqulhaq