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

Duration of over 24h can not be displayed #16

Closed deiga closed 10 years ago

deiga commented 11 years ago

This seems to lack the support for dispplaying 24:54 Hours as it instead displays 00:54 Hours

lucasmartins commented 10 years ago

This may be biased but I don't think that's an issue at all, the standard timing is 24 hours a day, so you can't have more than that for any given day. You could easily customize that though:

def extend_zero_hour(s)
  if s.start_with? "00:"
    s.sub!("00:","24:")
  end
  s
end

I'm guessing it's a little late for that answer, but it might help any newcomers.

Cheers!

lucasmartins commented 10 years ago

@peleteiro I guess you could close this issue... : )