diff --git a/schedule/parse.php b/schedule/parse.php index 59a699e..923f53e 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -1,8 +1,15 @@ ='); + +if ($strftimeDeprecated) { + require 'php-8.1-strftime.php'; +} + +$strftime = fn(...$args) => $strftimeDeprecated ? PHP81_BC\strftime(...$args) : \strftime(...$args); function parseData($config, $data) { + global $strftime; + $languages = array( 'en' => array( 'name' => 'English', @@ -237,7 +244,7 @@ function parseData($config, $data) { $columns = []; if (date('d.m', $microslots[$slot_index][0]) !== date('d.m', $lastTs)) { - $schedule_body .= '' . strftime('%d %B - %A', $microslots[$slot_index][0]) . ''; + $schedule_body .= '' . $strftime('%d %B - %A', $microslots[$slot_index][0]) . ''; } $lastTs = $microslots[$slot_index][0];