Module: QuarterStrMethods

Included in:
ActiveSupport::TimeWithZone, DateTime, Time
Defined in:
lib/ruby-rails-extensions/extensions/quarter_str.rb

Instance Method Summary collapse

Instance Method Details

#quarter_strString

Returns the quarter and year using the following template:

<quarter_number>Q<quarter_year(yy)>

Returns:



12
13
14
# File 'lib/ruby-rails-extensions/extensions/quarter_str.rb', line 12

def quarter_str
  "#{(month / 3.0).ceil}Q#{strftime('%y')}"
end