|
@@ -14,8 +14,20 @@ class EnSalle implements RuntimeExtensionInterface
|
|
|
return false;
|
|
|
}
|
|
|
$interval = new \DateInterval('P20D');
|
|
|
- $dateLimite= $dateSortie->add($interval);
|
|
|
+ $dateLimite = $dateSortie->add($interval);
|
|
|
$date = new \DateTime('now');
|
|
|
return ( $date <= $dateLimite && $date >= $dateSortie);
|
|
|
}
|
|
|
+
|
|
|
+ public function bientotEnSalle(?\DateTimeImmutable $dateSortie): bool
|
|
|
+ {
|
|
|
+ if (!$dateSortie) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $interval = new \DateInterval('P15D');
|
|
|
+ $interval->invert = 1;
|
|
|
+ $dateLimite = $dateSortie->add($interval);
|
|
|
+ $date = new \DateTime('now');
|
|
|
+ return ( $date >= $dateLimite && $date < $dateSortie );
|
|
|
+ }
|
|
|
}
|