diff options
author | Carlos Brando <eduardobrando@gmail.com> | 2008-09-19 09:06:35 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-09-19 09:06:35 -0500 |
commit | 79f55de9c5e3ff1f8d9e767c5af21ba31be4cfba (patch) | |
tree | 64ec2b1a15c381dbda8f979672f883e9e12c12ce /activesupport/lib/active_support/core_ext/time | |
parent | 2d27b82d4cf446543539ad20afcbad256d8aeff7 (diff) | |
download | rails-79f55de9c5e3ff1f8d9e767c5af21ba31be4cfba.tar.gz rails-79f55de9c5e3ff1f8d9e767c5af21ba31be4cfba.tar.bz2 rails-79f55de9c5e3ff1f8d9e767c5af21ba31be4cfba.zip |
Fixed Time#end_of_quarter to not blow up on May 31st [#313 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/calculations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |