From 49f2e6f8d4002185b53f7108463a50b55e4aa86e Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Fri, 4 Apr 2008 03:29:30 +0000 Subject: Time #yesterday and #tomorrow behave correctly crossing DST boundary. Closes #7399 [sblackstone] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/calculations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 867ac86617..0bc83af709 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -221,12 +221,12 @@ module ActiveSupport #:nodoc: # Convenience method which returns a new Time representing the time 1 day ago def yesterday - self.ago(1.day) + advance(:days => -1) end # Convenience method which returns a new Time representing the time 1 day since the instance time def tomorrow - self.since(1.day) + advance(:days => 1) end def plus_with_duration(other) #:nodoc: -- cgit v1.2.3