From b4021977022c4e1c7a31a0846118a2f278f59fc4 Mon Sep 17 00:00:00 2001 From: vince Date: Sun, 26 Dec 2021 18:54:52 +0100 Subject: [PATCH] tente de corriger un bug sur le calcul des dates adjacentes --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index b953da2..97367c6 100644 --- a/index.php +++ b/index.php @@ -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;