From 79f55de9c5e3ff1f8d9e767c5af21ba31be4cfba Mon Sep 17 00:00:00 2001 From: Carlos Brando Date: Fri, 19 Sep 2008 09:06:35 -0500 Subject: Fixed Time#end_of_quarter to not blow up on May 31st [#313 state:resolved] Signed-off-by: Joshua Peek --- activesupport/lib/active_support/core_ext/time/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 070f72c854..3cc6d59907 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -223,7 +223,7 @@ module ActiveSupport #:nodoc: # Returns a new Time representing the end of the quarter (last day of march, june, september, december, 23:59:59) def end_of_quarter - change(:month => [3, 6, 9, 12].detect { |m| m >= self.month }).end_of_month + beginning_of_month.change(:month => [3, 6, 9, 12].detect { |m| m >= self.month }).end_of_month end alias :at_end_of_quarter :end_of_quarter -- cgit v1.2.3