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