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

Duration initialisation from -ve numeric (seconds). #36

Closed alexdilley closed 8 years ago

alexdilley commented 8 years ago

Construct ISO pattern from absolute value, placing sign at front of – instead of within – string.

arnau commented 8 years ago

Hi @figwit, could you elaborate on what is the use case for this change?

alexdilley commented 8 years ago

The change aims to fix a bug, parsing ISO8601::Duration.new(-3600) as -PT3600S instead of PT-3600S, and supports a use case such as:

ISO8601::Duration.new(datetime_in_the_past - datetime_in_the_future)
arnau commented 8 years ago

Got it, thanks. I'll review it soon.

arnau commented 8 years ago

Thanks, I released the patch in v0.9.1

alexdilley commented 8 years ago

👍