Skip to content

Commit

Permalink
Sort blog posts by date
Browse files Browse the repository at this point in the history
Added a line of code to sort blog posts in descending order based on their published date. This ensures that the most recent posts appear first in the MobileBlogOverviewBox.
  • Loading branch information
leewyatt committed Jul 10, 2024
1 parent 6cdacb5 commit 87fd249
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected Task<Void> createTask() {
@Override
protected Void call() throws InterruptedException {
List<Post> posts = DataRepository2.getInstance().loadPosts(blog);
posts.sort((o1, o2) -> o2.getSyndEntry().getPublishedDate().compareTo(o1.getSyndEntry().getPublishedDate()));
Thread.sleep(500);
Platform.runLater(() -> {
listView.getItems().setAll(posts);
Expand Down

0 comments on commit 87fd249

Please sign in to comment.