Re: [PEPr] Comment on Date and Time::Date_Holidays
| From: | Lorenzo Alberton | Date: | Sun, 20 Jun 2004 14:51:19 +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-30958@lists.php.net to get a copy of this message | ||
Hi,
On Sun, 20 Jun 2004 16:17:15 +0200, Carsten Lucke wrote:
>> but the final user must be able to customize his data (maybe he
>> wants to filter some holidays out).
> Well, filtering out holidays you're not interested in works
> already. You can see that here -
> http://pear.tool-garage.de/Date_Holidays/examples-src/.
great. Sorry, I hadn't seen that.
>> Is there any difference between
>> Date_Holidays_Driver_Christian::_calcEaster() and the php
>> function easter_date()? [5]
> easter_date() returns a timestamp and I tried to avoid using
> timestamps in the package.
does it work on <1970 and 2037< dates too?
Otherwise, you can convert the timestamp to ISO
with a simple date('Y-m-d H:i:s', easter_date($year));
call...
A small optimization tip:
============================
function &_calcEaster($year)
{
static $easter_dates = array();
if (array_key_exists($year, $easter_dates) {
return $easter_dates[$year];
}
//calc easter date and store it in $easter_date[$year];
}
============================
Regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo