From bb141390f2f6c7817be92b4d0db2501a58c681c8 Mon Sep 17 00:00:00 2001 From: Tatiana Villa Ema Date: Mon, 27 Apr 2026 00:56:49 +0200 Subject: [PATCH] fix: tendencia historica muestra todos los anos --- frontend/js/estadisticas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/js/estadisticas.js b/frontend/js/estadisticas.js index f24e769..0407d5f 100644 --- a/frontend/js/estadisticas.js +++ b/frontend/js/estadisticas.js @@ -227,8 +227,8 @@ function loadCurrentMonth() { const yearBusqueda = yearActual; const monthBusqueda = selectedMonth + 1; - // 1. Primer día del mes (Siempre el 01) - const firstDay = `${yearBusqueda}-${String(monthBusqueda).padStart(2, "0")}-01`; + // 1. Primer día del mes, retrocediendo 5 años para incluir histórico + const firstDay = `${yearBusqueda - 5}-${String(monthBusqueda).padStart(2, "0")}-01`; // 2. Calculamos el último día teórico del mes let ultimoDiaObj = new Date(yearBusqueda, monthBusqueda, 0);