refactor year data validation to cal.rb