diff options
author | Xavier Noria <fxn@hashref.com> | 2010-05-02 01:12:31 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-05-02 01:12:31 +0200 |
commit | 7aaabea5175be4b01697684e7573b422629206e6 (patch) | |
tree | b5cdc8809c50b702a41043b95415b174b21584ee /activesupport/lib/active_support/core_ext/date/calculations.rb | |
parent | 1b898cc946f69808d5fa0db922ba100fb8ffcfe3 (diff) | |
download | rails-7aaabea5175be4b01697684e7573b422629206e6.tar.gz rails-7aaabea5175be4b01697684e7573b422629206e6.tar.bz2 rails-7aaabea5175be4b01697684e7573b422629206e6.zip |
let Date.yesterday and Date.tomorrow be based on Date.current rather than Date.today
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date/calculations.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/calculations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index 9d2ad2bbcf..fef49e1003 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -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. |