Skip to content

Commit

Permalink
Merge pull request #145 from brown-ccv/feat-blog-sort
Browse files Browse the repository at this point in the history
change sort order of blog cards from newest to oldest
  • Loading branch information
Ashley S. Lee authored Feb 16, 2024
2 parents 17c4cb4 + 05e13e7 commit 80a1a78
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 80a1a78

Please sign in to comment.