Skip to content

Commit

Permalink
change sort order of blog cards from newest to oldest
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysyg committed Feb 16, 2024
1 parent 17c4cb4 commit 05e13e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/blocks/MarkdownToCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ export default {
});
} else if (this.sortBy.name === 'Date') {
// Sort by date
filtered.sort((a, b) => {
return new Date(a.date) - new Date(b.date);
});
filtered
.sort((a, b) => {
return new Date(a.date) - new Date(b.date);
})
.reverse();
} else if (this.sortBy.name === 'Author') {
// Sort by author
filtered.sort((a, b) => {
Expand Down

0 comments on commit 05e13e7

Please sign in to comment.