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
> 
I have an old copy of Computer Language that includes the C source for 
Julian dates.  One of the functions is the determination of Easter for 
any given year.  If you are interested in just that algorithm or the 
entire code let me know.  I assume that the determination of 
Thanksgiving (for the US) would be trivial from there.
The only other real problem is that some states, Nevada for example, 
change at least one of the holidays, where the state doesn't take 
Columbus day off but takes off October 31st -- state admission day.