fix bug in holiday parsing

This commit is contained in:
Jon Goldberg 2023-05-29 18:26:00 -04:00
parent b2de878240
commit 447b4caecb
No known key found for this signature in database
GPG Key ID: C2D2247364F9DB13

8
oncall.php Normal file → Executable file
View File

@ -233,9 +233,11 @@ class oncall {
// Is today a holiday? // Is today a holiday?
if ($holidays->isHoliday($today)) { if ($holidays->isHoliday($today)) {
$this->everyone = TRUE; $this->everyone = TRUE;
$todaysHoliday = $holidays->on($today); $todaysHolidayIterator = $holidays->on($today);
$holidayName = $todaysHoliday->getName(); foreach ($todaysHolidayIterator as $todaysHoliday) {
$this->sendToMattermost("Happy $holidayName Megaphone Tech! There is no on-call today."); $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. // Don't do anything else if it's a holiday or weekend.
if (!$holidays->isWorkingDay($today)) { if (!$holidays->isWorkingDay($today)) {