From 0f2c43864350cf56f4dbf196d4336ee6d399bee1 Mon Sep 17 00:00:00 2001 From: fede Date: Mon, 30 Nov 2026 02:07:22 -0300 Subject: [PATCH] correjido formato de fecha Signed-off-by: fede --- front/src/routes/almacenes/+page.svelte | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/front/src/routes/almacenes/+page.svelte b/front/src/routes/almacenes/+page.svelte index 965d3d8..6143787 100644 --- a/front/src/routes/almacenes/+page.svelte +++ b/front/src/routes/almacenes/+page.svelte @@ -37,6 +37,16 @@ let almacenSeleccionado = $state(null); let almacenAEliminar = $state(null); let almacenAAlta = $state(null); + + function formatearFecha(valor?: string | null): string { + if (!valor) return '-'; + const fecha = new Date(valor); + if (isNaN(fecha.getTime())) return String(valor); + const dia = String(fecha.getDate()).padStart(2, '0'); + const mes = String(fecha.getMonth() + 1).padStart(2, '0'); + const año = fecha.getFullYear(); + return `${dia}/${mes}/${año}`; + }
@@ -98,7 +108,7 @@ {a.id} {a.codigo} {a.ubicacion || '-'} - {String(a.CreatedAt ?? '-')} + {formatearFecha(a.CreatedAt)} {#if a.DeletedAt} Eliminado @@ -174,5 +184,3 @@ almacenAAlta = null; }} /> -EOF -echo done \ No newline at end of file