From 301a4c7302f18daac888953898c86a416209252d Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Mon, 7 Mar 2022 21:23:21 -0300 Subject: [PATCH] FIX: DateInterval --- app/Service/Informe/Contabilidad/Resumen.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index bddba58..6d429c8 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -3,6 +3,7 @@ namespace App\Service\Informe\Contabilidad; use DateTimeInterface; use DateTimeImmutable; +use DateInterval; use Incoviba\old\Proyecto\Proyecto; use Incoviba\old\Venta\Venta; use Incoviba\old\Venta\Pago; @@ -33,7 +34,7 @@ class Resumen } protected function startOfYear(DateTimeInterface $up_to) { - return new DateTimeImmutable((clone $up_to)->sub('P1Y')->format('31-12-Y')); + return new DateTimeImmutable((clone $up_to)->sub(new DateInterval('P1Y'))->format('31-12-Y')); } protected function defaultValueDate(DateTimeInterface $up_to) {