Skip to content

Commit

Permalink
Fix date sorting for Safari.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Oct 3, 2023
1 parent 9980286 commit d3c1a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@
if (!b["Date Added"]) return -1;

// Convert date strings to Date objects for comparison
const dateA = new Date(a["Date Added"]);
const dateB = new Date(b["Date Added"]);
const dateA = new Date(a["Date Added"].replace(/-/g, "/"));
const dateB = new Date(b["Date Added"].replace(/-/g, "/"));

// Compare the dates
if (dateA < dateB) return 1;
Expand Down

0 comments on commit d3c1a1a

Please sign in to comment.