Sha256: 92f39d31ac5aa0dafa1dae4581123698b0aa9f42f72b0957126d21f8db2cf45a
Contents?: true
Size: 400 Bytes
Versions: 12
Compression:
Stored size: 400 Bytes
Contents
module Ufo module PrettyTime # http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby def pretty_time(total_seconds) minutes = (total_seconds / 60) % 60 seconds = total_seconds % 60 if total_seconds < 60 "#{seconds.to_i}s" else "#{minutes.to_i}m #{seconds.to_i}s" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems