From f5e768ca99535452aec7317340109e4f43a85149 Mon Sep 17 00:00:00 2001 From: lemuel Date: Tue, 18 Apr 2023 09:27:06 -0600 Subject: [PATCH] dejar de cancelar al minuto --- src/prestamo/prestamo.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/prestamo/prestamo.service.ts b/src/prestamo/prestamo.service.ts index c441966..f4cda48 100644 --- a/src/prestamo/prestamo.service.ts +++ b/src/prestamo/prestamo.service.ts @@ -290,9 +290,9 @@ export class PrestamoService { id_prestamo: number | Prestamo, ): Promise { const ahora = moment(); - + if (this.add) ahora.add(this.add, 'h'); - + const ahoraStr = ahora.format('YYYY-MM-DD'); const prestamo = typeof id_prestamo === 'number' @@ -463,11 +463,14 @@ export class PrestamoService { } findAllActivosExpirados(): Promise { + const ahora = moment(); + + if (this.add) ahora.add(this.add, 'h'); return this.informacionPrestamoView .find({ where: { activo: 1, - hora_max_recoger: LessThanOrEqual(moment().toDate()), + hora_max_recoger: LessThanOrEqual(ahora.toDate()), id_status: 2, }, })