method

end_of_quarter

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Calculations
end_of_quarter() public

Returns a new date/time at the end of the quarter.

today = Date.today # => Fri, 10 Jul 2015
today.end_of_quarter # => Wed, 30 Sep 2015

DateTime objects will have a time set to 23:59:59.

now = DateTime.current # => Fri, 10 Jul 2015 18:41:29 +0000
now.end_of_quarter # => Wed, 30 Sep 2015 23:59:59 +0000
Show source
Register or log in to add new notes.