Skip to content
Snippets Groups Projects
Commit a2bbbdc3 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

fix pb de date

parent 24e94e83
No related branches found
No related tags found
No related merge requests found
Pipeline #38413 passed
...@@ -30,6 +30,7 @@ class InstanceAsTextHelper extends AbstractHelper ...@@ -30,6 +30,7 @@ class InstanceAsTextHelper extends AbstractHelper
$categories = $formulaire->getCategories(); $categories = $formulaire->getCategories();
$categories = array_filter($categories, function (Categorie $categorie) use ($date) { $categories = array_filter($categories, function (Categorie $categorie) use ($date) {
if ($date === null) return $categorie->estNonHistorise();
$wasExisting = ($categorie->getHistoCreation() === null or $categorie->getHistoCreation() <= $date); $wasExisting = ($categorie->getHistoCreation() === null or $categorie->getHistoCreation() <= $date);
$wasntHistorise = ($categorie->getHistoDestruction() === null or $categorie->getHistoDestruction() >= $date); $wasntHistorise = ($categorie->getHistoDestruction() === null or $categorie->getHistoDestruction() >= $date);
return ($wasExisting and $wasntHistorise); return ($wasExisting and $wasntHistorise);
...@@ -42,6 +43,7 @@ class InstanceAsTextHelper extends AbstractHelper ...@@ -42,6 +43,7 @@ class InstanceAsTextHelper extends AbstractHelper
$champs = $categorie->getChamps(); $champs = $categorie->getChamps();
$champs = array_filter($champs, function (Champ $champ) use ($date) { $champs = array_filter($champs, function (Champ $champ) use ($date) {
if ($date === null) return $champ->estNonHistorise();
$wasExisting = ($champ->getHistoCreation() === null or $champ->getHistoCreation() <= $date); $wasExisting = ($champ->getHistoCreation() === null or $champ->getHistoCreation() <= $date);
$wasntHistorise = ($champ->getHistoDestruction() === null or $champ->getHistoDestruction() >= $date); $wasntHistorise = ($champ->getHistoDestruction() === null or $champ->getHistoDestruction() >= $date);
return ($wasExisting and $wasntHistorise); return ($wasExisting and $wasntHistorise);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment