From: Daniel Berger Date: 2007-01-03T04:05:10+09:00 Subject: Re: Detecting holidays Bira wrote: > On 1/2/07, Daniel Berger 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