chronic_duration
chronic_duration copied to clipboard
ChronicDuration::parse("0min") returns nil, not 0
ChronicDuration::parse("0") returns nil, not 0. ChronicDuration::parse("0s") returns nil, not 0. ChronicDuration::parse("0min") returns nil, not 0.
This is unexpected behavior, since those are valid strings that represent a time duration of zero.
+1 for this; there should if nothing else be a configuration option. I'm happy to add it, but just in case am wondering if there's any particular reason that ChronicDuration::parse() has this behavior (so I can avoid breaking it with my patch).
same here, we were trying ChronicDuration.parse("00:00") and it returned quite unexpectedly nil instead of 0.
This can be closed per #23 - if you want zeros from parse or output, use the option :keep_zero => true
, as per the updated readme.