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)    
Subscription  


 [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"

Comments

 [2006-04-01 17:21 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!