This commit is contained in:
James Cole 2019-11-09 07:55:59 +01:00
parent e3418b1bd2
commit adc4b00f5d
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -83,6 +83,7 @@ class Navigation
$date->$function($add); $date->$function($add);
// if period is 1M and diff in month is 2 and new DOM > 1, sub a number of days: // if period is 1M and diff in month is 2 and new DOM > 1, sub a number of days:
// AND skip is 1
// result is: // result is:
// '2019-01-29', '2019-02-28' // '2019-01-29', '2019-02-28'
// '2019-01-30', '2019-02-28' // '2019-01-30', '2019-02-28'
@ -90,7 +91,7 @@ class Navigation
$months = ['1M', 'month', 'monthly']; $months = ['1M', 'month', 'monthly'];
$difference = $date->month - $theDate->month; $difference = $date->month - $theDate->month;
if (2 === $difference && $date->day > 0 && in_array($repeatFreq, $months, true)) { if (1 === $add && 2 === $difference && $date->day > 0 && in_array($repeatFreq, $months, true)) {
$date->subDays($date->day); $date->subDays($date->day);
} }