Re: [PEPr] Comment on Date and Time::Date_Holidays
| From: | Stephan Schmidt | Date: | Sun, 20 Jun 2004 17:39:54 +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-30967@lists.php.net to get a copy of this message | ||
Hi Lorenzo,
Build a holiday management class and a common driver interface, but don't ship baked drivers with it (they're ok in the /examples/ dir), since they can't be flexible enough for all users. I disagree with you here. In most use cases your client will need some kind of calendar application. So either Date_Holidays already provides a collection of the holidays for the country your customers lives in or not. If they are provided by Date_Holidays, it's great. Otherwise the main work surely is the research on how to calculate the holdidays and not implementing a class with some simple methods. If you've done the research, just send the new class to the maintainer of Date_Holidays and let him add your driver.As stated in my other posting, we could easily add custom drivers that read holidays from any type of file...
well, I designed it to be really slim and low on resources, you should give it a try :-) I took a look at it once, seemed to be powerful and easy-to-use. But that's not the point here. If a user builds a site, that's only in German and thus needs German titles for the holidays he will need to install Translation2 and set up a container. Then he needs to translate all names (or we supply the translations for all Translation2 container types). This is extra work for the user.
AFAICS, the current Date_Holidays class has all the translations hardcoded in the class as well? What if I want to add another translation? Either you include it in the class and send it to the maintainer (like in Quickform) or you use Translation2 in your script.Maybe Carsten could add optional support. If you pass a Translation2 Container to the driver, it will query the container for the holiday title, otherwise it will use the internal translation array... Would this make you happy? Stephan