[PEPr] Comment on Date and Time::Date_Holidays
| From: | PEPr | Date: | Sun, 20 Jun 2004 13:09:25 +0000 |
| Subject: | [PEPr] Comment on Date and Time::Date_Holidays | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-30951@lists.php.net to get a copy of this message | ||
Lorenzo Alberton (http://pear.php.net/user/quipo) has commented on the proposal for Date and
Time::Date_Holidays.
Comment:
This is a package that can be really useful, a perfect companion to PEAR::Calendar. Thanks for
proposing it!
Just a few suggestions:
don't store holidays in the class, but provide a method to import them from a datasource (.ini
file, database, whatever). The class
should provide some baked data files as examples, but the final user must be able to customize his
data (maybe he wants to filter some holidays out). Also, the final user probably prefers handling
simple text files than writing new classes just to add a few holidays:
=====[myFeasts.ini]==========
[newYearsEve]
dateType = fixed
month = 1
day = 1
[Whitsun]
dateType = floating
date = [Easter] + 49
=============================
<shameless plug>
Internationalization management could be delegated to external classes like PEAR::Translation2 [1]
& [2], and Localization to PEAR::I18Nv2 [3] & [4]
</shameless plug>
Is there any difference between Date_Holidays_Driver_Christian::_calcEaster() and the php function
easter_date()? [5]
I don't know if it is useful, but what about separating/differentiating fixed-date holidays
(new year's eve) from floating-date ones (Easter)? (See .ini example above)
Some other pedantic notes:
- please always use english names ($jahr => $year)
- Even if the studlyCaps convention for holiday names is ok, they should start with a capital letter
('petrusAndPaulus' => 'PetrusAndPaulus')
[1] http://pear.php.net/package/Translation2
[2] http://pear.php.net/manual/en/package.internationalization.translation2.php
[3] http://pear.php.net/package/I18Nv2
[4] http://pear.php.net/manual/en/package.internationalization.php
[5] http://www.php.net/easter_date
Anyway, this is a pretty nice package!
Cheers,
--
Lorenzo Alberton
http://pear.php.net/user/quipo
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=85
--
Sent by PEPr, the automatic proposal system at http://pear.php.net