fix: tendencia historica muestra todos los anos

This commit is contained in:
Tatiana Villa Ema 2026-04-27 00:56:49 +02:00
parent 09583e1112
commit bb141390f2
1 changed files with 2 additions and 2 deletions

View File

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