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);