Realmente me estoy tirando del pelo ahora y me estoy volviendo loco:
const {year, month} = req.headers; const date_range_from = new Date(year, month, 1); const date_range_to = new Date(year, month + 1, 1); // wrong year; why? console.log("year, month: ", year, month) console.log("date_range_from, date_range_to: ", date_range_from, date_range_to)El registro de la consola da:
year, month: 2021 6 date_range_from, date_range_to: 2021-06-30T15:00:00.000Z 2026-01-31T15:00:00.000Z¿POR QUÉ 2026???? ¿¿¿Qué está pasando???