Module: PassiveSupport::CoreExtensions::Date::Calculations::ClassMethods
- Defined in:
- lib/passive_support/core_ext/date/calculations.rb
Instance Method Summary collapse
-
#current ⇒ Object
Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.
-
#tomorrow ⇒ Object
Returns a new Date representing the date 1 day after today (i.e. tomorrow’s date).
-
#yesterday ⇒ Object
Returns a new Date representing the date 1 day ago (i.e. yesterday’s date).
Instance Method Details
#current ⇒ Object
Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.
30 31 32 |
# File 'lib/passive_support/core_ext/date/calculations.rb', line 30 def current ::Time.zone_default ? ::Time.zone.today : ::Date.today end |