Re: Date_Holidays

From: Date: Sat, 18 Oct 2003 20:00:42 +0000
Subject: Re: Date_Holidays
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22801@lists.php.net to get a copy of this message
Hi Stephan, This would be very useful. I have some working code that calculates a few holidays like American Thanksgiving, Memorial Day, and also several other random holidays (Labor Day, etc.). It also calculates major Jewish holidays like Rosh Hashanah, I'd be happy to make my old and rather scrappy code available to extract some algorithms. The code is used as a backed for calendar.chiaraquartet.net It would be great to see the code PEARified and unit tested. Regards, Greg Stephan Schmidt wrote:
Hi, I will have to implement a calendar in PHP that knows when certain holidays (like easter) are. I thought about implementing the algorithm in a class called Date_Holidays, so it can be used in PEAR. But as different countries have different holidays (in the US, labour day is in September, in Germany it's in May) I thought about a factory method like: $holidays = Date_Holidays::getHolidays('Germany'); This will return an object Date_Holidays_German, so at a later point Date_Holdays_France, etc. could be implemented. The object could then supply some methods to check whether a date is a holiday, list all holidays in a certain year or return one holiday for one year... Any thoughts or comments about this? I'll probably start working on this next monday. Stephan --- Stephan Schmidt schst@php-tools.net http://www.php-tools.net


« previous php.pear.dev (#22801) next »