Skip to content

Instantly share code, notes, and snippets.

@jfernandez
Created June 2, 2010 22:58
Show Gist options
  • Save jfernandez/423143 to your computer and use it in GitHub Desktop.
Save jfernandez/423143 to your computer and use it in GitHub Desktop.
def created_on_off_hours?
return false unless self.created_at
created_on_weekend = [0, 6].include?(self.created_at.wday)
created_friday_night = self.created_at.wday == 5 && self.created_at.hour >= 19
created_on_weekend || created_friday_night
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment