josedonizetti / ruby-duration

Immutable type that represents some amount of time with accuracy in seconds.
http://bit.ly/ruby-duration
MIT License
124 stars 23 forks source link

Doesn't fully support actual ISO8601 Duration format #34

Open lacostenycoder opened 5 years ago

lacostenycoder commented 5 years ago

Duration has years months, days, hours, minutes, seconds. So why not support all of these?

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"

Shouldn't the output return the same format as the input?