correjido formato de fecha

Signed-off-by: fede <federico.nicolas.polidoro@gmail.com>
This commit is contained in:
fede committed 2026-11-30 02:07:22 -03:00
1 parent bda647011e
commit 0f2c438643
1 file changed
+11 -3
+11 -3
View File
@@ -37,6 +37,16 @@
let almacenSeleccionado = $state<Almacen | null>(null);
let almacenAEliminar = $state<Almacen | null>(null);
let almacenAAlta = $state<Almacen | null>(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}`;
}
</script>
<Header />
@@ -98,7 +108,7 @@
<TableCell>{a.id}</TableCell>
<TableCell>{a.codigo}</TableCell>
<TableCell>{a.ubicacion || '-'}</TableCell>
<TableCell>{String(a.CreatedAt ?? '-')}</TableCell>
<TableCell>{formatearFecha(a.CreatedAt)}</TableCell>
<TableCell>
{#if a.DeletedAt}
<Tag type="red">Eliminado</Tag>
@@ -174,5 +184,3 @@
almacenAAlta = null;
}}
/>
EOF
echo done