Re: [PEPr] Comment on Date and Time::Date_Holidays
| From: | Carsten Lucke | Date: | Sun, 20 Jun 2004 18:23:59 +0000 |
| Subject: | Re: [PEPr] Comment on Date and Time::Date_Holidays | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30972@lists.php.net to get a copy of this message | ||
Hi,
PEPr wrote:
Sérgio Carvalho (http://pear.php.net/user/sergiosgc) has commented on the proposal for Date and Time::Date_Holidays. I'd like to comment a few things. First, I agree with <a href="http://pear.php.net/pepr/pepr-comments-show.php?id=85">Lorenzo</a>. The sheer ammount of different holidays will require that the author can accept contributions of holiday description data. It will be much easier for people to contribute holiday lists if no code needs to be written. The package should define a description format for holiday calendars. Well, regarding things Stephan mentioned before, I still prefer the driver-based way. ;-) Additionally I could provide a way to generate drivers from a plain-text file, that uses a certain syntax. But for more complex calculations someone would have to modify the generated driver afterwards. Importing holidays from files into the driver could be implemented as well.
Then, I'd like to know how can City holiday calendars be handled. In Portugal, at least, each city may define its own city holiday. The rest of the holiday calendar is common country-wide. Would a specific class need to be defined for each city, and the combined with the country calendar class? Won't this result in an explosion of classes to an exotic number?I see two ways of doing this. 1st: Define an own driver for the specific city, that extends the driver for Portugal 2nd: The Portugal-driver contains the holidays for all cities (that maybe a bad idea, depends on the amount of holidays) and you use the built-in filtering methods of Date_Holidays to restrict your results. Regards, Carsten