|
|
@ -15,11 +15,17 @@ if ((new DateTime())->getTimeStamp() >= $tues_ts) { |
|
|
|
$ts = strtotime('+1 month', $ts); |
|
|
|
$ts = strtotime('+1 month', $ts); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This for PHP >= 8.1 as the old strftime will be deprecated by then |
|
|
|
|
|
|
|
// $date_time = new DateTime(); |
|
|
|
|
|
|
|
// $date_time->setTimestamp(strtotime('fourth tuesday of this month', $ts)); |
|
|
|
foreach ($fil as $line) { |
|
|
|
foreach ($fil as $line) { |
|
|
|
|
|
|
|
// Skip empty lines |
|
|
|
|
|
|
|
if (strlen($line)) { |
|
|
|
$fields = array_filter(explode('|', $line)); |
|
|
|
$fields = array_filter(explode('|', $line)); |
|
|
|
if (count($fields) == 2) { |
|
|
|
if (count($fields) == 2) { |
|
|
|
// Date missing, insert |
|
|
|
// Date missing, insert |
|
|
|
$tuesday = strftime('%A, %d.%m.%Y ', strtotime('fourth tuesday of this month', $ts)); |
|
|
|
$tuesday = strftime('%A, %d.%m.%Y ', strtotime('fourth tuesday of this month', $ts)); |
|
|
|
|
|
|
|
// $tuesday = datefmt_format_object($date_time, 'cccc, d.M.yyyy ', 'de_DE.utf8'); |
|
|
|
array_unshift($fields, $tuesday); |
|
|
|
array_unshift($fields, $tuesday); |
|
|
|
} |
|
|
|
} |
|
|
|
$ts = strtotime('+1 month', $ts); |
|
|
|
$ts = strtotime('+1 month', $ts); |
|
|
@ -33,5 +39,6 @@ foreach ($fil as $line) { |
|
|
|
} |
|
|
|
} |
|
|
|
array_push($arr, '|' . $li . '|'); |
|
|
|
array_push($arr, '|' . $li . '|'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
file_put_contents($file_md, implode(PHP_EOL, $arr) . PHP_EOL); |
|
|
|
file_put_contents($file_md, implode(PHP_EOL, $arr) . PHP_EOL); |
|
|
|
?> |
|
|
|
?> |
|
|
|