This commit is contained in:
James Cole 2017-09-25 07:32:29 +02:00
parent 0b0e0054b3
commit 96419fb359
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -62,6 +62,13 @@ class Navigation
$function = $functionMap[$repeatFreq];
$date->$function($add);
// if period is 1M and diff in month is 2 and new DOM = 1, sub a day:
$months = ['1M', 'month', 'monthly'];
$difference = $date->month - $theDate->month;
if (in_array($repeatFreq, $months) && $difference === 2 && $date->day === 1) {
$date->subDay();
}
return $date;
}