format('Y-m-d'); return (int) $day->format('N') <= 5 && $this->holidays->activeDatesBetween($date, $date) === []; } /** * The first working day after the given day. */ public function nextAfter(DateTimeImmutable $day): DateTimeImmutable { $next = $day->modify('+1 day'); // A month of days off in a row would be a mistake in the settings. for ($i = 0; $i < 31 && ! $this->isWorkingDay($next); $i++) { $next = $next->modify('+1 day'); } return $next; } }