Skip to content

Commit

Permalink
replaced x variable name with item to make it more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
arandel1 committed Sep 20, 2024
1 parent 0d550c9 commit 547cad0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/api/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,23 +260,23 @@ export function comparePurchaseUrgency(list) {
return daysUntilNextPurchaseB > daysUntilNextPurchaseA ? -1 : 1;
});

sortedList.forEach((x) => {
const dateNextPurchasedAsDate = x.dateNextPurchased?.toDate();
sortedList.forEach((item) => {
const dateNextPurchasedAsDate = item.dateNextPurchased?.toDate();

const daysUntilNextPurchase = getDaysBetweenDates(
currentDate,
dateNextPurchasedAsDate,
);
if (daysUntilNextPurchase < 0) {
overdue.push(x);
overdue.push(item);
} else if (daysUntilNextPurchase >= 0 && daysUntilNextPurchase <= 7) {
soon.push(x);
soon.push(item);
} else if (daysUntilNextPurchase > 7 && daysUntilNextPurchase < 30) {
kindOfSoon.push(x);
kindOfSoon.push(item);
} else if (daysUntilNextPurchase >= 30 && daysUntilNextPurchase < 60) {
notSoon.push(x);
notSoon.push(item);
} else if (daysUntilNextPurchase >= 60) {
inactive.push(x);
inactive.push(item);
}
});

Expand Down

0 comments on commit 547cad0

Please sign in to comment.