Module: WorkingDays
- Defined in:
- lib/working_days.rb,
lib/working_days/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
Instance Method Details
#plus_working_days(number_of_days = 0) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/working_days.rb', line 4 def plus_working_days(number_of_days = 0) res = self number_of_days.times do |i| res = res + 1.day while [0,6].include?(res.wday) #or h = Holiday.find(:first, :conditions => ["start_date <= ? AND end_date >= ?", res.strftime('%Y-%m-%d'), res.strftime('%Y-%m-%d')]) res = res + 1.day end end res end |