class Integer
Constants
- AGE_CHILDREN_START_SCHOOL
Public Instance Methods
Source
# File lib/core_ext/integer/academic_year.rb, line 4 def to_academic_year_date_range start_date = Date.new(self, 9, 1) end_date = Date.new(self + 1, 8, 31) start_date..end_date end
Source
# File lib/core_ext/integer/year_group.rb, line 6 def to_year_group(academic_year: nil) (academic_year || Date.current.academic_year) - self - AGE_CHILDREN_START_SCHOOL end
Also aliased as: to_birth_academic_year