sortie > 1 month
This commit is contained in:
@@ -89,6 +89,10 @@ class SortieController extends AbstractController
|
||||
$this->addFlash('error', 'Cette sortie n\'existe pas.');
|
||||
return $this->redirectToRoute('home');
|
||||
}
|
||||
if ($sortie->getDateHeureDebut() < (new DateTime())->modify('-1 month')) {
|
||||
$this->addFlash('error', "Cette sortie à plus de 30 jours.");
|
||||
return $this->redirectToRoute('home');
|
||||
}
|
||||
|
||||
return $this->render('sortie/view.html.twig', [
|
||||
'sortie' => $sortie,
|
||||
|
||||
Reference in New Issue
Block a user