mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
fix incorrect data aggregated by fiscal year in trend analysis
This commit is contained in:
+1
-3
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user