let Date.yesterday and Date.tomorrow be based on Date.current rather than Date.today

This commit is contained in:
Xavier Noria
2010-05-02 01:12:31 +02:00
parent 1b898cc946
commit 7aaabea517

View File

@@ -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.