FIX: Fecha comparación para terreno
This commit is contained in:
@ -33,7 +33,7 @@ class Terreno extends Ideal\Service
|
|||||||
try {
|
try {
|
||||||
$proyecto = $this->proyectoRepository->fetchById($proyecto_id);
|
$proyecto = $this->proyectoRepository->fetchById($proyecto_id);
|
||||||
$today = new DateTimeImmutable();
|
$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) {
|
if ($proyecto->terreno->fecha >= $lastDecember) {
|
||||||
return $proyecto->terreno;
|
return $proyecto->terreno;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user