diff --git a/frontend/becario.html b/frontend/becario.html index 26ac4c3..46d3bef 100644 --- a/frontend/becario.html +++ b/frontend/becario.html @@ -40,6 +40,12 @@ function fmtDT(iso) { timeZone: "America/Mexico_City", day: "2-digit", month: "short", hour: "2-digit", minute: "2-digit", }); } +// Día de la semana (capitalizado) en America/Mexico_City, p.ej. "Martes". +function fmtDia(iso) { + if (!iso) return ""; + const d = new Date(iso).toLocaleDateString("es-MX", { timeZone: "America/Mexico_City", weekday: "long" }); + return d.charAt(0).toUpperCase() + d.slice(1); +} const fmtHoras = (h) => `${(h ?? 0).toLocaleString("es-MX", { maximumFractionDigits: 1 })} h`; function localToIso(v) { return v ? new Date(v).toISOString() : null; } @@ -254,6 +260,7 @@ function Portal({ session, onSalir }) { {jornadas.slice(0, 20).map((j, i, arr) => (
+
{fmtDia(j.entrada_ts)}
{fmtDT(j.entrada_ts)} → {j.salida_ts ? fmtDT(j.salida_ts) : "sin salida"}
diff --git a/frontend/panel.html b/frontend/panel.html index 269a541..c2e3d46 100644 --- a/frontend/panel.html +++ b/frontend/panel.html @@ -44,6 +44,12 @@ function fmtDT(iso) { year: "numeric", hour: "2-digit", minute: "2-digit", }); } +// Día de la semana (capitalizado) en America/Mexico_City, p.ej. "Martes". +function fmtDia(iso) { + if (!iso) return ""; + const d = new Date(iso).toLocaleDateString("es-MX", { timeZone: "America/Mexico_City", weekday: "long" }); + return d.charAt(0).toUpperCase() + d.slice(1); +} function fmtHoras(h) { return `${(h ?? 0).toLocaleString("es-MX", { maximumFractionDigits: 1 })} h`; } // ISO(UTC) ↔ valor de (zona local del navegador) function isoToLocal(iso) { @@ -393,7 +399,10 @@ function VistaBecario({ becarioId, onBack, onError }) { {jornadas.map((j) => ( - +
{fmtDT(j.entrada_ts)} +
{fmtDia(j.entrada_ts)}
+ {fmtDT(j.entrada_ts)} +
{fmtDT(j.salida_ts)} {j.concepto || "—"} {j.duracion_minutos != null ? `${(j.duracion_minutos / 60).toFixed(1)} h` : "—"}