Skip to content

Commit

Permalink
Merge pull request #453 from range-of-motion/show-most-recent-transac…
Browse files Browse the repository at this point in the history
…tions-first-in-overview

Show most recent transactions first in overview
  • Loading branch information
range-of-motion authored Dec 4, 2023
2 parents f3f13cc + 4f6d658 commit b8d94bf
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 b8d94bf

Please sign in to comment.