chronic_duration icon indicating copy to clipboard operation
chronic_duration copied to clipboard

parse(keep_zero: true) treats empty strings like 0

Open regentgal opened this issue 6 years ago • 1 comments

[50] pry(main)> ChronicDuration.parse("   ")
=> nil
[51] pry(main)> ChronicDuration.parse("   ", keep_zero: true)
=> 0

I believe that empty strings should still be treated as invalid and return nil. There is a difference between not entering anything and explicitly entering 0.

regentgal avatar Nov 28 '18 19:11 regentgal

It also treats strings like "cow" as 0

shepmaster avatar Jul 10 '19 16:07 shepmaster