From e6fa86ad3951853fc885f0de577cde354ce3f2bd Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 19 Dec 2016 17:37:06 +0100 Subject: [PATCH] Exclude birthdays from holidays in calendar category report --- calendar/inc/class.calendar_category_report.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_category_report.inc.php b/calendar/inc/class.calendar_category_report.inc.php index ae0e167573..0b813767c7 100644 --- a/calendar/inc/class.calendar_category_report.inc.php +++ b/calendar/inc/class.calendar_category_report.inc.php @@ -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; } /**