Sha256: a9eb6574838aca3d0656bfc6637f2b99ca624f29cfde1c4742cd67d8904bc423

Contents?: true

Size: 252 Bytes

Versions: 26

Compression:

Stored size: 252 Bytes

Contents

require 'time_diff'

module DashingContrib
  class Time
    class << self
      def readable_diff(old_time, new_time = ::Time.now)
        t = ::Time.diff(new_time, old_time)
        "#{t[:day]}d #{t[:hour]}h #{t[:minute]}m"
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
dashing-contrib-0.2.9 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.8 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.7 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.6 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.5 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.4 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.3 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.2 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.1 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.2.0 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.14 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.12 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.11 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.10 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.9 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.8 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.7 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.6 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.5 lib/dashing-contrib/bottles/time.rb
dashing-contrib-0.1.4 lib/dashing-contrib/bottles/time.rb