Skip to content

Instantly share code, notes, and snippets.

@iande
Created May 31, 2011 12:32
Show Gist options
  • Select an option

  • Save iande/1000431 to your computer and use it in GitHub Desktop.

Select an option

Save iande/1000431 to your computer and use it in GitHub Desktop.
make_year
def self.make_year(year, bias)
# Check for year > 2 digits, etc
# ...
start_year = Chronic.time_class.now.year - bias
century = (start_year / 100) * 100
full_year = century + year
if full_year < start_year
full_year + 100
else
full_year
end.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment