From: Phrogz Date: 2007-01-17T06:05:06+09:00 Subject: Re: Calculate number of non-weekend days between two dates? Dale Martenson wrote: > A more useful twist might be to collect the weekdays and return an > array: How about: require 'date' d1 = Date.new( 2006, 12, 1 ) d2 = Date.new( 2007, 1, 15 ) WEEKDAY_NUMBERS = [1,2,3,4,5] weekdays = (d1..d2).select{ |d| WEEKDAY_NUMBERS.include?( d.wday ) } p weekdays.length #=> 32