Fixed gen_vor.php

master
gitea 2 years ago
parent ad65a1014c
commit cba051386c
  1. 8
      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?

Loading…
Cancel
Save