|
|
|
@ -30,6 +30,7 @@ if ($first_wedn->format('md') == '0301') { |
|
|
|
|
} |
|
|
|
|
$tues_ts = strtotime($number . ' tuesday of this month', $ts); |
|
|
|
|
$tues_date = (new DateTime())->setTimeStamp($tues_ts); |
|
|
|
|
$wed_ts = strtotime('next day', $tues_ts); |
|
|
|
|
|
|
|
|
|
const JUST_DATE = 'Ymd'; |
|
|
|
|
|
|
|
|
@ -38,10 +39,11 @@ $month = $first_day->format('n'); |
|
|
|
|
$cond = true; |
|
|
|
|
if ($month == 2 || $month == 3) { |
|
|
|
|
$cond = $first_day->format(JUST_DATE) != $first_wedn->format(JUST_DATE) && $tues_date->format('md') != '0322'; |
|
|
|
|
printf('Cond: %d\n', $cond); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Are we past the fourth Tuesday of this month? |
|
|
|
|
if ((new DateTime())->getTimeStamp() >= $tues_ts && $cond) { |
|
|
|
|
if ((new DateTime())->getTimeStamp() >= $wed_ts && $cond) { |
|
|
|
|
$ts = strtotime('+1 month', $ts); |
|
|
|
|
/* |
|
|
|
|
var_dump($tues_date->format('md')); |
|
|
|
|