fix(auditoria completa): bloqueos de Mi Dia, cobranza (saldos y fechas), captura (departamento y rol), contactos (privacidad), cotizador (QR) y validaciones de API

This commit is contained in:
2026-09-21 07:18:39 +00:00
parent 75956a709f
commit 5e9b2ac456
16 changed files with 259 additions and 71 deletions

View File

@@ -18,9 +18,17 @@ export function formatoFechaLarga(fecha: Date): string {
return fecha.toLocaleDateString('es-MX', { day: 'numeric', month: 'long', year: 'numeric' })
}
/** ISO 'YYYY-MM-DD' a fecha legible corta: "08/10/2027" */
export function formatoFechaCorta(iso: string): string {
return new Date(`${iso}T00:00:00`).toLocaleDateString('es-MX', {
/**
* Fecha ISO ('YYYY-MM-DD' o ISO completo con hora, como lo manda el API) a
* fecha legible corta: "08/10/2027". Antes se concatenaba 'T00:00:00' a la
* cadena y con las fechas con hora salía "Invalid Date" en los PDFs.
*/
export function formatoFechaCorta(iso: string | null | undefined): string {
if (!iso) return '—'
const soloFecha = String(iso).slice(0, 10)
const fecha = new Date(`${soloFecha}T00:00:00`)
if (Number.isNaN(fecha.getTime())) return '—'
return fecha.toLocaleDateString('es-MX', {
day: '2-digit',
month: '2-digit',
year: 'numeric',