Skip to content

Instantly share code, notes, and snippets.

@timrogers
Created September 11, 2013 19:58
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 timrogers/6528957 to your computer and use it in GitHub Desktop.
Save timrogers/6528957 to your computer and use it in GitHub Desktop.
in_business configuration
# Configure the gem with hours of your choice, on a day-by-day basis
InBusiness.hours = {
monday: "09:00".."18:00",
tuesday: "10:00".."19:00",
# ...
saturday: "09:00".."12:00"
}
InBusiness.open? # => true (if now is within the set hours)
InBusiness.open? DateTime.parse("9th September 2013 08:00") # => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment