Skip to content

Commit

Permalink
Update blog.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jespermhl committed May 31, 2024
1 parent d0d996d commit 27c751c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ document.addEventListener("DOMContentLoaded", function () {

// Call the fetchJSONFile function to load data from the JSON file
fetchJSONFile("/scripts/blogposts.json", function (jsonData) {
// Sort data by published date (assuming the date is in a consistent format)
// Sort data by published date
jsonData.sort(function (a, b) {
return new Date(b.published_date) - new Date(a.published_date);
});
Expand Down

0 comments on commit 27c751c

Please sign in to comment.