lib/knj/strings.rb in knjrbfw-0.0.79 vs lib/knj/strings.rb in knjrbfw-0.0.80

- old
+ new

@@ -269,16 +269,16 @@ return parts[0].to_s end end #Returns a short time-format for the given amount of seconds. - def self.secs_to_human_short_time(secs) + def self.secs_to_human_short_time(secs, args = nil) secs = secs.to_i - return "#{secs}s" if secs < 60 + return "#{secs}s" if secs < 60 and (!args or !args.key?(:secs) or args[:secs]) mins = (secs.to_f / 60.0).floor - if mins < 60 + if mins < 60 and (!args or !args.key?(:mins) or args[:mins]) return "#{mins.to_i}m" end hours = (mins.to_f / 60.0) return "#{Knj::Locales.number_out(hours, 1)}t" \ No newline at end of file