From 864af56481aea5a0b2fa8fd796e511e26b6c0f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Tue, 7 Jul 2026 11:56:23 -0600 Subject: [PATCH] =?UTF-8?q?feat(jornadas):=20muestra=20el=20d=C3=ADa=20de?= =?UTF-8?q?=20la=20semana=20en=20cada=20jornada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En la tabla de jornadas del portal del becario y del panel de la supervisora, cada registro muestra el día de la semana (Martes, Sábado, …) derivado de la entrada, en America/Mexico_City. Helper fmtDia en ambos frontends. Co-Authored-By: Claude Fable 5 --- frontend/becario.html | 7 +++++++ frontend/panel.html | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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` : "—"}