instance method
end_of_quarter
Ruby on Rails 4.0.13
Since v4.0.13Signature
end_of_quarter()
Returns a new date/time at the end of the quarter. Example: 31st March, 30th June, 30th September. DateTime objects will have a time set to 23:59:59.
Source
# File activesupport/lib/active_support/core_ext/date_and_time/calculations.rb, line 97
def end_of_quarter
last_quarter_month = [3, 6, 9, 12].detect { |m| m >= month }
beginning_of_month.change(:month => last_quarter_month).end_of_month
end
Defined in activesupport/lib/active_support/core_ext/date_and_time/calculations.rb line 97
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateAndTime::Calculations