Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/kin/core_ext/time.rb

Instance Method Summary collapse

Instance Method Details

#fuzzyString

Fuzzy-formats the time. If the date is yesterday, today or tomorrow, a simpler date will be given.

Examples:

Today.

Time.now.fuzzy # => "Today at 19:05"

Some time ago.

1.week.ago.fuzzy # => "Wednesday 29th July at 19:05"

Returns:



14
15
16
# File 'lib/kin/core_ext/time.rb', line 14

def fuzzy
  "#{to_date.fuzzy} #{formatted(:time)}"
end