fix(analysis): don't skip any months for inflation, just check if data exists

This commit is contained in:
Jose Selesan
2026-08-27 10:22:13 -03:00
parent e32131d32e
commit 0c634bbc8b

View File

@@ -123,15 +123,6 @@ export function MonthlyVariationTable() {
const sortedMonths = [...monthsMap.keys()].sort();
const today = new Date();
const currentMonth = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}`;
const lastMonthDate = new Date(
today.getFullYear(),
today.getMonth() - 1,
1,
);
const lastCompleteMonth = `${lastMonthDate.getFullYear()}-${String(lastMonthDate.getMonth() + 1).padStart(2, "0")}`;
const calcVariation = (
currentVal: number | null,
prevVal: number | null,
@@ -160,14 +151,7 @@ export function MonthlyVariationTable() {
);
let inflation: number | null = null;
const dayOfMonth = today.getDate();
const skipLastComplete = dayOfMonth < 14;
if (
month !== currentMonth &&
!(skipLastComplete && month === lastCompleteMonth)
) {
inflation = inflationMap.get(month) ?? null;
}
inflation = inflationMap.get(month) ?? null;
return {
month,