|
|
@ -40,16 +40,16 @@ function findNext($start, $frequency, $excludes = [], $vsNow = true, $maxIterati |
|
|
|
while ( |
|
|
|
(!$vsNow or ($current->getTimestamp() < $now->getTimestamp())) |
|
|
|
and ($maxIterations-- > 0) |
|
|
|
) $current->add($frequency); |
|
|
|
) $current->add($frequency); |
|
|
|
} else { |
|
|
|
while ( |
|
|
|
(!$vsNow or ($current->getTimestamp() > $now->getTimestamp())) |
|
|
|
and ($maxIterations-- > 0) |
|
|
|
) $current->sub($frequency); |
|
|
|
) $current->sub($frequency); |
|
|
|
} |
|
|
|
$nextEvent = $current->format('Y-m-d'); |
|
|
|
} while ( |
|
|
|
in_array($nextEvent, $excludes) |
|
|
|
!in_array($nextEvent, $excludes) |
|
|
|
and ($maxIterations > 0) |
|
|
|
); |
|
|
|
return $current; |
|
|
|