Open smcabrera opened 9 years ago
We already have a problem that this gem doesn't correctly support ISO 8061 Duration, for example calling this method should return the same value as the input but it doesn't.
irb(main):004:0> d = Duration.new('P3Y6M4DT12H30M5S')
=> #<Duration:0x007fdb4ea67df0 @seconds=5, @negative=false, @total=110766605, @weeks=183, @days=1, @hours=0, @minutes=30>
irb(main):005:0> d.iso8601
=> "P1282DT30M5S"
Currently outputting as a string gives you the following:
I'd love to implement a to_s function that would cause durations to output a little more like the way the
Time
class works:Something like this:
The only issue I can think of is that you allow for days and weeks and I'm not sure what format those should be outputted in...thoughts?