From 12a549f7f2a112dbb5e1506114f86d76a04800ec Mon Sep 17 00:00:00 2001 From: asyncnomi Date: Tue, 3 Jan 2023 23:11:42 +0100 Subject: [PATCH] bla --- static/js/main.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 3204b35..ffbcd60 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -111,7 +111,7 @@ function get_admin(type) { data.prankData[prankUid].prankUid = prankUid; prankData.push(data.prankData[prankUid]); } - prankData.sort((a, b) => Date(a.date) - Date(b.date)); + prankData.sort((a, b) => new Date(a.date) - new Date(b.date)); for (entry in prankData) { switch (prankData[entry].type) { case "crêpe": @@ -156,7 +156,7 @@ function get_admin(type) { data.treasureData[treasureUid].treasureUid = treasureUid; treasureData.push(data.treasureData[treasureUid]); } - treasureData.sort((a, b) => Date(a.date) - Date(b.date)); + treasureData.sort((a, b) => new Date(a.date) - new Date(b.date)); for (entry in treasureData) { if (treasureData[entry].state == "pending") { $("#admin-content").append(` @@ -201,8 +201,7 @@ function get_admin(type) { data.activityData[activityUid].activityUid = activityUid; activityData.push(data.activityData[activityUid]); } - console.log(activityData) - activityData.sort((a, b) => Date(a.start) - Date(b.start)); + activityData.sort((a, b) => new Date(a.start) - new Date(b.start)); for (entry in activityData) { if (activityData[entry].type = "event") { $("#admin-content").append(`