From 7ddd09bc7a8cfb76cf2cb7b6d1186886c5e2cabe Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Thu, 24 Nov 2022 22:50:55 +0100 Subject: [PATCH] Better date limits --- index.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index d79e1df..27cf3ae 100644 --- a/index.php +++ b/index.php @@ -112,12 +112,11 @@ Zur groben Einordnung: Eine Fahrt dauert rund 9 Stunden und kostet pro Person mi
setTimestamp(mktime(0, 0, 0, $START_DATE[1], $START_DATE[2], $START_DATE[0])); -print_month($start); -$month_end = (new DateTimeImmutable())->setTimestamp(strtotime("first day of next month", $start->getTimestamp())); -print_month($month_end); -$month_end = (new DateTimeImmutable())->setTimestamp(strtotime("first day of next month", $month_end->getTimestamp())); -print_month($month_end); +$date = new DateTimeImmutable(); +while ($date->diff((new DateTimeImmutable())->setTimestamp(mktime(0, 0, 0, 3, 1, 2023)))->invert == 0) { + print_month($date); + $date = (new DateTimeImmutable())->setTimestamp(strtotime("first day of next month", $date->getTimestamp())); +} ?>