Number of workdays between two dates
It is pretty simple to get number of work days between two dates. For example we can get the number of workdays in this month.
start_date = Date.civil(2010, 8, 1)
end_date = Date.civil(2010, 8, 31)
workdays = (start_date..end_date).select { |day| ![0, 6].include?(day.wday) }.size

Vlado Cingel is Rails developer from Croatia. Apart from Ruby & Rails, I really enjoy scripting in JavaScript and converting designs into great HTML & CSS. 



Recent Comments