From: James Herdman Date: 2008-06-04T10:03:45+09:00 Subject: Re: Commercial Calendar Calculations ------=_Part_2509_6207934.1212541473522 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Eric, Both. So, if you ask the program to schedule "every first Friday of the month", if Friday is a holiday, the program should schedule a Thursday (likewise, if you say "every last day of the month", if the last day is a holiday, the first business day prior would be scheduled). It's quite a complicated situation. I thought Runt (as Donald mentioned) might help, but I'm not sure it will. James On Tue, Jun 3, 2008 at 6:39 PM, Eric I. wrote: > On Jun 3, 3:43 pm, James Herdman wrote: > > I'm interested in doing calculations with a commercial calendar. For > > example, "Find every 2nd business day of the month for 2008". I'm > feeling a > > little long on how to approach the topic. Does anyone know of a library > I > > could leverage for such a thing (the ability to use said library in Rails > is > > a must)? If not, does anyone have experience that they could share on > the > > matter? > > When you say "2nd business day", do you mean logic like, "the 2nd of > the month if it's Tuesday-Friday or the first Monday of the month > otherwise"? Or do you want to take into account a list of holidays > that might make certain weekdays not count as business days? > > If it's the former, you could use the Date class (in the 'date' > library). I don't know of a library that handles issues such as > holidays; have you've combed through rubyforge.org? > > Eric > > ==== > > LearnRuby.com offers Rails & Ruby HANDS-ON public & ON-SITE > workshops. > Ruby Fundamentals Wkshp June 16-18 Ann Arbor, Mich. > Ready for Rails Ruby Wkshp June 23-24 Ann Arbor, Mich. > Ruby on Rails Wkshp June 25-27 Ann Arbor, Mich. > Ruby Plus Rails Combo Wkshp June 23-27 Ann Arbor, Mich > Please visit http://LearnRuby.com for all the details. > > ------=_Part_2509_6207934.1212541473522--