diff --git a/gen_vor.php b/gen_vor.php index 8df99fd..2351e5e 100644 --- a/gen_vor.php +++ b/gen_vor.php @@ -21,7 +21,13 @@ $fil = file($file_txt, FILE_IGNORE_NEW_LINES); // Insert header $arr = ['| | | |', '|:------|:------|:------|']; $ts=(new DateTime('first day of this month'))->getTimeStamp(); -$tues_ts = strtotime('fourth wednesday of this month', $ts); +$first_wedn = new DateTime('first wednesday of this month'); +$wednesday = 'fourth'; +// Treat March differently +if ($first_wedn->format('md') == '0301') { + $wednesday = 'fifth'; +} +$tues_ts = strtotime($wednesday . ' wednesday of this month', $ts); $tues_date = (new DateTime())->setTimeStamp($tues_ts); // Are we past the fourth Tuesday of this month?