Exclude birthdays from holidays in calendar category report

This commit is contained in:
Hadi Nategh 2016-12-19 17:37:06 +01:00
parent a719f8b01f
commit e6fa86ad39

View File

@ -61,13 +61,19 @@ class calendar_category_report extends calendar_ui{
/**
* Function to check if the given date is a holiday date
*
* @param int $date timestamp as date
* @param int $_date timestamp as date
*
* @return boolean returns true if the date is holiday
*/
public function isHoliday($date)
public function isHoliday($_date)
{
return array_key_exists(date('Ymd', $date), $this->bo->read_holidays(date('Y', $date)));
$holidays = $this->bo->read_holidays(date('Y', $_date));
$date = date('Ymd', $_date);
foreach ($holidays[$date] as $holiday)
{
if (is_array($holiday) && !$holiday['birthyear']) return true;
}
return false;
}
/**