motion/core_ext/date_and_time/calculations.rb
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
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
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.