Skip to content

Instantly share code, notes, and snippets.

@byroot
Created March 9, 2011 10:08
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 byroot/861986 to your computer and use it in GitHub Desktop.
Save byroot/861986 to your computer and use it in GitHub Desktop.
def workday?(date)
1 <= date.wday <= 5
end
workday_count_between(start_date, end_date)
(start_date..end_date).count{ |d| workday?(d)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment