Normalize transaction dates to the start of the day in projectedTransactions computation

This commit is contained in:
Jennie Robinson Faber 2025-08-23 15:16:16 +01:00
parent c6214a34ff
commit dca853e96b

View file

@ -483,6 +483,7 @@ const projectedTransactions = computed(() => {
const transactions = cashFlow.filteredTransactions.value;
const projectedTransactions = [];
const today = new Date();
today.setHours(0, 0, 0, 0); // Normalize to start of day
const endDate = new Date(today.getTime() + 13 * 7 * 24 * 60 * 60 * 1000); // 13 weeks from now
transactions.forEach((transaction) => {
@ -550,6 +551,7 @@ const projectedTransactions = computed(() => {
} else if (transaction.type === "one-time") {
// Include one-time transactions that fall within the next 13 weeks
const transactionDate = new Date(transaction.date);
transactionDate.setHours(0, 0, 0, 0); // Normalize to start of day
if (transactionDate >= today && transactionDate <= endDate) {
projectedTransactions.push({
...transaction,