Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/active_date_range/core_ext/date.rb
Instance Method Summary collapse
-
#quarter ⇒ Object
Returns the number of the quarter for this date.
Instance Method Details
#quarter ⇒ Object
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 |