From 447b4caecb9961c7b341df0f895aa9975e935425 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 29 May 2023 18:26:00 -0400 Subject: [PATCH] fix bug in holiday parsing --- oncall.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 oncall.php diff --git a/oncall.php b/oncall.php old mode 100644 new mode 100755 index 0c09b11..3c37a76 --- a/oncall.php +++ b/oncall.php @@ -233,9 +233,11 @@ class oncall { // Is today a holiday? if ($holidays->isHoliday($today)) { $this->everyone = TRUE; - $todaysHoliday = $holidays->on($today); - $holidayName = $todaysHoliday->getName(); - $this->sendToMattermost("Happy $holidayName Megaphone Tech! There is no on-call today."); + $todaysHolidayIterator = $holidays->on($today); + foreach ($todaysHolidayIterator as $todaysHoliday) { + $holidayName = $todaysHoliday->getName(); + } + // $this->sendToMattermost("Happy $holidayName Megaphone Tech! There is no on-call today."); } // Don't do anything else if it's a holiday or weekend. if (!$holidays->isWorkingDay($today)) {