mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
let Date.yesterday and Date.tomorrow be based on Date.current rather than Date.today
This commit is contained in:
@@ -7,12 +7,12 @@ class Date
|
||||
class << self
|
||||
# Returns a new Date representing the date 1 day ago (i.e. yesterday's date).
|
||||
def yesterday
|
||||
::Date.today.yesterday
|
||||
::Date.current.yesterday
|
||||
end
|
||||
|
||||
# Returns a new Date representing the date 1 day after today (i.e. tomorrow's date).
|
||||
def tomorrow
|
||||
::Date.today.tomorrow
|
||||
::Date.current.tomorrow
|
||||
end
|
||||
|
||||
# Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.
|
||||
|
||||
Reference in New Issue
Block a user