From: Todd Benson Date: 2008-07-19T19:58:20+09:00 Subject: Re: Finding the date of an event based on related events. On Fri, Jul 18, 2008 at 5:04 PM, Siep Korteling wrote: > To exclude just the weekends you could do > > class Date > def add_workdays(n) > days_to_add =((self.cwday+n-1)/5)*2 +n > self + days_to_add > end > end > > Which returns a new Date and seems to work with negative n's. (Just > wrote this code, don't know if it's bullet proof). It isn't. It won't work if you start from a weekend day. Use today (Saturday), and do d = Date.today.add_workdays(5) puts d => 2008-07-28 I like the approach, though. Todd