avoid daylight savings time rounding issue on number of days

This commit is contained in:
Robert Dyer
2026-05-21 16:55:36 -05:00
parent 867694ce9a
commit f967435881
+3 -1
View File
@@ -41,7 +41,9 @@ function daysInYear(year) {
const lastDate = await getLastTransactionDate(account, cutoff);
if (!lastDate) continue;
const daysPassed = Math.floor((interestTransactionDate - new Date(lastDate)) / 86400000);
const daysPassed = Math.round(
(interestTransactionDate.setHours(0, 0, 0, 0) - new Date(lastDate).setHours(0, 0, 0, 0)) / 86400000
);
let period = 12;
let numPeriods = 1