Sha256: fa0849b9511aaf4e5c073bc0dfb4dfc76965c3fbe4a0a32a43130549511d1be0

Contents?: true

Size: 294 Bytes

Versions: 2

Compression:

Stored size: 294 Bytes

Contents

require "reverse_chronic/version"

module ReverseChronic
  class << self
    def humanize(time)
      if time.to_date == Date.today
        'today'
      elsif Time.now.to_date - 1 == time.to_date
        'yesterday'
      else
        time.strftime('%A, %b%e, %Y')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reverse_chronic-0.0.1 lib/reverse_chronic.rb
reverse_chronic-0.0.1.beta lib/reverse_chronic.rb