From 7aaabea5175be4b01697684e7573b422629206e6 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 2 May 2010 01:12:31 +0200 Subject: let Date.yesterday and Date.tomorrow be based on Date.current rather than Date.today --- activesupport/lib/active_support/core_ext/date/calculations.rb | 4 ++-- 1 file 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. -- cgit v1.2.3