James Cole
2024-07-06 15:50:20 +02:00
parent d5667c7ef6
commit dc675707f9
3 changed files with 12 additions and 4 deletions

View File

@@ -408,10 +408,15 @@ class RecurringRepository implements RecurringRepositoryInterface
private function filterMaxDate(?Carbon $max, array $occurrences): array
{
if (null === $max) {
return $occurrences;
}
$filtered = [];
if (null === $max) {
foreach ($occurrences as $date) {
if ($date->gt(today())) {
$filtered[] = $date;
}
}
return $filtered;
}
foreach ($occurrences as $date) {
if ($date->lte($max) && $date->gt(today())) {
$filtered[] = $date;