Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/active_date_range/core_ext/date.rb

Instance Method Summary collapse

Instance Method Details

#quarterObject

Returns the number of the quarter for this date

Date.new(2021, 1, 1).quarter # => 1


7
8
9
# File 'lib/active_date_range/core_ext/date.rb', line 7

def quarter
  (month / 3.0).ceil
end