Skip to content

Instantly share code, notes, and snippets.

@jonbuda
Created April 23, 2010 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonbuda/376728 to your computer and use it in GitHub Desktop.
Save jonbuda/376728 to your computer and use it in GitHub Desktop.
DAYS_BEFORE_OPTIONS = [0,1,2,3,4,5,6,7,14,21,28]
DAYS_BEFORE_IN_WORDS = ['the day of'] + (1..6).map {|day| "#{day} days before"} + (1..4).map {|week| "#{week} weeks before"}
def self.options_for_days_before
DAYS_BEFORE_OPTIONS.map do |days|
[DAYS_BEFORE_IN_WORDS[DAYS_BEFORE_OPTIONS.index(days)], days]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment