Skip to content

Commit

Permalink
Show most recent transactions first in overview
Browse files Browse the repository at this point in the history
  • Loading branch information
range-of-motion committed Dec 4, 2023
1 parent f3f13cc commit 4f6d658
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions resources/assets/js/prototype/screens/Transactions/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ const getMonthName = (month) => {
};
const getTransactionsBySpan = (span) => {
return transactions.value.filter(transaction => {
const happenedOn = new Date(transaction.happened_on);
return transactions.value
.filter(transaction => {
const happenedOn = new Date(transaction.happened_on);
return happenedOn.getMonth() + 1 === span.month && happenedOn.getFullYear() === span.year;
});
return happenedOn.getMonth() + 1 === span.month && happenedOn.getFullYear() === span.year;
})
.sort((a, b) => {
return b.id - a.id;
});
};
const fetchTransactions = () => {
Expand Down

0 comments on commit 4f6d658

Please sign in to comment.