Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.21.8

Bug #7193 Missing parameter filter to isHoliday in Composite driver
Submitted: 2006-03-24 09:49 UTC
From: jw at php dot net Assigned: schst
Status: Closed Package: Date_Holidays (version 0.15.1)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    

 [2006-03-24 09:49 UTC] jw at php dot net (Jan Wagner)
Description: ------------ When using the composite driver and you call isHoliday(DATE, FILTER) on it, the filter is not applied. When looking at the source in Date/Holidays/Driver/Composite.php, you can see the parameter ist missing and will not be passed on to the added drivers of the compound. This is easily fixed and seems to have been forgotten. Test script: --------------- require_once 'Date/Holidays.php'; require_once 'Date/Holidays/Filter/Germany/Saxony.php'; $holidaysThisYear = Date_Holidays::factory('Germany', 2006, 'de_DE'); $holidaysNextYear = Date_Holidays::factory('Germany', 2007, 'de_DE'); $holidays = Date_Holidays::factory('Composite'); $holidays->addDriver($holidaysThisYear); $holidays->addDriver($holidaysNextYear); $holidayFilter = new Date_Holidays_Filter_Germany_Saxony; if ($holidays->isHoliday(strtotime('2006-04-13'), $holidayFilter)) { echo 'HOLIDAY'; } else { echo 'NO HOLIDAY'; } Expected result: ---------------- "NO HOLIDAY" Actual result: -------------- "HOLIDAY"


 [2006-04-01 17:21 UTC] schst (Stephan Schmidt)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.