Skip to content

Instantly share code, notes, and snippets.

@itayadler
Created January 30, 2014 13:54
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 itayadler/8708773 to your computer and use it in GitHub Desktop.
Save itayadler/8708773 to your computer and use it in GitHub Desktop.
Ruby method for determining if the current time is during the jewish weekend
def jewish_weekend?(date=Time.now)
#Time.now.end_of_week will return sunday, so friday is -1 & saturday is -2
end_of_week = date.end_of_week
friday = end_of_week - 2.day
saturday = end_of_week - 1.day
(date.day == friday.day) || (date.day == saturday.day)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment