From 15301fda78603e389658a5908147b7c8fc7efcb2 Mon Sep 17 00:00:00 2001 From: Robert Dyer Date: Sun, 4 Aug 2024 18:22:21 -0500 Subject: [PATCH] fix getLastTransactionDate off by 1 day --- utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 8abb12e..06a8906 100644 --- a/utils.js +++ b/utils.js @@ -59,7 +59,11 @@ module.exports = { return data.data; }, - getLastTransactionDate: async function (account, cutoffDate=new Date()) { + getLastTransactionDate: async function (account, cutoffDate=undefined) { + if (cutoffDate === undefined) { + cutoffDate = new Date(); + cutoffDate.setDate(cutoffDate.getDate() + 1); + } const data = await api.runQuery( api.q('transactions') .filter({