arnau / ISO8601

Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
MIT License
75 stars 15 forks source link

Numeric operations with Duration Class #30

Closed Angelmmiguel closed 9 years ago

Angelmmiguel commented 9 years ago

With ISO8601::DateTime class you can do operations like these:

hour = 60*60
dt = ISO8601::DateTime.new('2014-05-28T19:53:10Z')
dt + hour

When you use this gem with Rails, it's very useful to work with a Numeric class because ActiveSupport provides us with a lot of time helpers: 1.month, 12.years...

I add Numeric operations feature to ISO8601::Duration class.

Angelmmiguel commented 9 years ago

I deleted TypeError clases because it was duplicated :)

arnau commented 9 years ago

Besides the comment above it looks good! Cheers

Angelmmiguel commented 9 years ago

Updated the documentation

arnau commented 9 years ago

:+1: