A Ruby on Rails gem that provides methods to work with ‘weekdays’ (ie. 5.weekdays_ago)
What it does
weekdays extends Rails’ Date, Time, DateTime, and Numeric ActiveSupport Core Extensions and gives you a handful of helpful methods that calculate spans of weekdays.
This gem ;)
How to Install
sudo gem install weekdays --source 'http://gemcutter.com'
Then add it to your environment.rb:
How to Use
You can now do cool things like:
.today.weekday? # => true 5.weekdays_ago # => Tue Mar 24 10:46:42 -0400 2009 11.weekdays_from_now # => Wed Apr 15 10:46:54 -0400 2009 20.weekdays_from(.yesterday) # => Mon, 27 Apr 2009 .today.weekdays_until(.tomorrow) # => 1