Module: Struggle::TimeExtend

Defined in:
lib/struggle/concerns/time_extend.rb

Instance Method Summary collapse

Instance Method Details

#quarterObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/struggle/concerns/time_extend.rb', line 3

def quarter
  month = self.month
  if month >= 1 && month <= 3
    1
  elsif month >= 4 && month <= 6
    2
  elsif month >= 7 && month <= 9
    3
  elsif month >= 10 && month <= 12
    4
  end
end