FIX: Fecha comparación para terreno

This commit is contained in:
Juan Pablo Vial
2024-11-20 12:19:04 -03:00
parent 62e7001fba
commit 1e2bd617fa

View File

@ -33,7 +33,7 @@ class Terreno extends Ideal\Service
try {
$proyecto = $this->proyectoRepository->fetchById($proyecto_id);
$today = new DateTimeImmutable();
$lastDecember = (new DateTimeImmutable($today->format('Y-01-01')));
$lastDecember = (new DateTimeImmutable($today->format('Y-01-01')))->sub(new DateInterval('P1M'));
if ($proyecto->terreno->fecha >= $lastDecember) {
return $proyecto->terreno;
}