Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/kin/core_ext/date.rb
Instance Method Summary collapse
-
#fuzzy ⇒ String
Fuzzy-formats the date.
Instance Method Details
#fuzzy ⇒ String
Fuzzy-formats the date. If the date is yesterday, today or tomorrow, a simpler date will be given.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kin/core_ext/date.rb', line 14 def fuzzy today = Date.today case self when today then 'Today' when today - 1 then 'Yesterday' when today + 1 then 'Tomorrow' else to_ordinalized_s(:date_only) end end |