def end_of_year(year)
      year_end = Date.new((year + 1), Date::MONTHNAMES.index(LAST_MONTH_OF_THE_YEAR), LAST_DAY_OF_THE_YEAR) # Jan 31st
      wday = (year_end.wday + 1) % 7 

      if wday > 3
        year_end += 7 - wday
      else
        year_end -= wday
      end
      year_end
    end
def end_of_year(year)
      year_end = Date.new((year + 1), Date::MONTHNAMES.index(LAST_MONTH_OF_THE_YEAR), LAST_DAY_OF_THE_YEAR) # Jan 31st
      wday = (year_end.wday + 1) % 7 

      if wday > 3
        year_end += 7 - wday
      else
        year_end -= wday
      end
      year_end
    end
The the first date of the retail year

 @param year [Integer] the retail year
 @return [Date] the first date of the retail year