Sha256: 9af7255a015c5d08f36009e69d962987053acb927dd5bc77ed559fa38c6764d0

Contents?: true

Size: 371 Bytes

Versions: 18

Compression:

Stored size: 371 Bytes

Contents

module Doing
  ##
  ## Date helpers
  ##
  class ::Time
    def relative_date
      if self > Date.today.to_time
        strftime('%_I:%M%P')
      elsif self > (Date.today - 6).to_time
        strftime('%a %_I:%M%P')
      elsif self.year == Date.today.year
        strftime('%m/%d %_I:%M%P')
      else
        strftime('%m/%d/%Y %_I:%M%P')
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
doing-2.1.3 lib/doing/time.rb
doing-2.1.2pre lib/doing/time.rb
doing-2.1.1pre lib/doing/time.rb
doing-2.1.0pre lib/doing/time.rb
doing-2.0.25 lib/doing/time.rb
doing-2.0.24 lib/doing/time.rb
doing-2.0.23 lib/doing/time.rb
doing-2.0.22 lib/doing/time.rb
doing-2.0.21 lib/doing/time.rb
doing-2.0.20 lib/doing/time.rb
doing-2.0.19 lib/doing/time.rb
doing-2.0.18 lib/doing/time.rb
doing-2.0.17 lib/doing/time.rb
doing-2.0.16 lib/doing/time.rb
doing-2.0.15 lib/doing/time.rb
doing-2.0.13 lib/doing/time.rb
doing-2.0.11 lib/doing/time.rb
doing-2.0.10 lib/doing/time.rb