fix incorrect data aggregated by fiscal year in trend analysis

This commit is contained in:
MaysWind
2025-06-08 23:10:02 +08:00
parent 5a47c74f83
commit ee47ee91c3
3 changed files with 10 additions and 12 deletions
+1 -3
View File
@@ -465,12 +465,10 @@ export function getAllFiscalYearsStartAndEndUnixTimes(startYearMonth: YearMonth
fiscalYearStart = FiscalYearStart.Default;
}
const fiscalYearStartMonth = fiscalYearStart.month;
// Loop over 1 year before and 1 year after the input date range
// to include fiscal years that start in the previous calendar year.
for (let year = range.startYearMonth.year - 1; year <= range.endYearMonth.year + 1; year++) {
const thisYearMonthUnixTime = getYearMonthFirstUnixTime({ year: year, month: fiscalYearStartMonth });
const thisYearMonthUnixTime = getYearMonthFirstUnixTime({ year: year, month: fiscalYearStart.month - 1 });
const fiscalStartTime = getFiscalYearStartUnixTime(thisYearMonthUnixTime, fiscalYearStart.value);
const fiscalEndTime = getFiscalYearEndUnixTime(thisYearMonthUnixTime, fiscalYearStart.value);