Well, the way I'm working it out is like AR's dynamic finders.  It
will have a few groups of dates hardcoded (like national holidays and
such), but then you can give it new groups in the form hashes of
arrays of dates with named "work_holidays" or "surprise_offdays" and
then call the method like is_a_work_holiday? or is_a_surprise_offday?.
  I'm still working on it...I'll post when I've got it done.

--Jeremy

On 1/2/07, Kenosis <kenosis / gmail.com> wrote:
>
> Daniel Berger wrote:
> > Bira wrote:
> > > On 1/2/07, Daniel Berger <djberg96 / gmail.com> wrote:
> > > > Hi all,
> > > >
> > > > Well, it took seven years, but I've finally been annoyed enough by
> > > > reports failing on national holidays to say something.  Report writers
> > > > know the routine:
> > >
> > > <...>
> > >
> > > The best way I know of checking for holidays is somehow keeping a
> > > record of which dates are holidays in a given year. It can be a
> > > database table, or some sort of configuration files when that isn't
> > > possible.
> > >
> > > This record would have to be mantained manually, but it would be just
> > > a simple case of editing the table/file every time you buy a new
> > > calendar :).
> >
> > For fixed holidays, sure - I think that's what Date::Calc does (i.e.
> > read an external file in, base on the selected country).  But for
> > floating holidays I would prefer a general algorithm.  Surely someone
> > can come up with a general algorithm for "3rd Thursday in November",
> > etc.  I'll bet the Rails folks already have something, but I haven't
> > looked.
> >
> > Regards,
> >
> > Dan
> And whatever solution, it needs to be dynamically updatable to account
> for suddenly announced national "holidays", like today happens to be -
> doh!
>
> Ken
>
>
>


-- 
My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/