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?
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)) {