Class/Module Index [+]

Quicksearch

ActiveSupport::CoreExtensions::Date::Calculations::ClassMethods

Public Instance Methods

current() click to toggle source

Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.

# File lib/active_support/core_ext/date/calculations.rb, line 30
def current
  ::Time.zone_default ? ::Time.zone.today : ::Date.today
end
tomorrow() click to toggle source

Returns a new Date representing the date 1 day after today (i.e. tomorrow's date).

# File lib/active_support/core_ext/date/calculations.rb, line 25
def tomorrow
  ::Date.today.tomorrow
end
yesterday() click to toggle source

Returns a new Date representing the date 1 day ago (i.e. yesterday's date).

# File lib/active_support/core_ext/date/calculations.rb, line 20
def yesterday
  ::Date.today.yesterday
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.