Skip to content

Instantly share code, notes, and snippets.

@joelr
Created February 15, 2012 15:33
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 joelr/1836722 to your computer and use it in GitHub Desktop.
Save joelr/1836722 to your computer and use it in GitHub Desktop.
#Not between 5:30pm Friday and 5:30pm Sunday
def support_available?(time_check = nil)
time_check ||= Time.now
!(time_check.wday == 6 || (time_check.wday == 5 && (time_check.hour > 17 || (time_check.hour == 17 && time_check.min >= 30))) || (time_check.wday == 0 && (time_check.hour < 17 || (time_check.hour == 17 && time_check.min <= 30))))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment