Normalize transaction dates to the start of the day in projectedTransactions computation
This commit is contained in:
parent
c6214a34ff
commit
dca853e96b
1 changed files with 2 additions and 0 deletions
|
|
@ -483,6 +483,7 @@ const projectedTransactions = computed(() => {
|
||||||
const transactions = cashFlow.filteredTransactions.value;
|
const transactions = cashFlow.filteredTransactions.value;
|
||||||
const projectedTransactions = [];
|
const projectedTransactions = [];
|
||||||
const today = new Date();
|
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
|
const endDate = new Date(today.getTime() + 13 * 7 * 24 * 60 * 60 * 1000); // 13 weeks from now
|
||||||
|
|
||||||
transactions.forEach((transaction) => {
|
transactions.forEach((transaction) => {
|
||||||
|
|
@ -550,6 +551,7 @@ const projectedTransactions = computed(() => {
|
||||||
} else if (transaction.type === "one-time") {
|
} else if (transaction.type === "one-time") {
|
||||||
// Include one-time transactions that fall within the next 13 weeks
|
// Include one-time transactions that fall within the next 13 weeks
|
||||||
const transactionDate = new Date(transaction.date);
|
const transactionDate = new Date(transaction.date);
|
||||||
|
transactionDate.setHours(0, 0, 0, 0); // Normalize to start of day
|
||||||
if (transactionDate >= today && transactionDate <= endDate) {
|
if (transactionDate >= today && transactionDate <= endDate) {
|
||||||
projectedTransactions.push({
|
projectedTransactions.push({
|
||||||
...transaction,
|
...transaction,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue