From d84846a636fbc180b3d6fcf52aa8559e1b7bb960 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Sat, 24 Nov 2007 03:57:11 +0000 Subject: Change Time and DateTime #end_of_month to return last second of month instead of beginning of last day of month. Closes #10200 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/date/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/date') diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index 61db7e0f12..b82f7be496 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -157,7 +157,7 @@ module ActiveSupport #:nodoc: # Returns a new Date/DateTime representing the end of the month (last day of the month; DateTime objects will have time set to 0:00) def end_of_month last_day = ::Time.days_in_month( self.month, self.year ) - self.acts_like?(:time) ? change(:day => last_day,:hour => 0, :min => 0, :sec => 0) : change(:day => last_day) + self.acts_like?(:time) ? change(:day => last_day, :hour => 23, :min => 59, :sec => 59) : change(:day => last_day) end alias :at_end_of_month :end_of_month -- cgit v1.2.3