From bc8e74a400ce13879ba6256d3d2cc02be953a8d1 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Sun, 2 Jun 2019 10:50:03 +0900 Subject: [PATCH] fix: [js] Contributors dates will now look: 2019-04-03@11:03 - Amend if unwanted. --- server.py | 2 +- static/js/contrib.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index ab2a2e5..91b2b1a 100755 --- a/server.py +++ b/server.py @@ -82,7 +82,7 @@ class LogItem(): def get_row(self): to_ret = {} - #Number to keep them sorted (jsonify sort keys) + # Number to keep them sorted (jsonify sort keys) for item in range(len(LogItem.FIELDNAME_ORDER)): try: to_ret[item] = self.fields[item] diff --git a/static/js/contrib.js b/static/js/contrib.js index 99f3fec..9e8fd67 100644 --- a/static/js/contrib.js +++ b/static/js/contrib.js @@ -346,7 +346,8 @@ function addLastContributor(datatable, data, update) { } else { last_added_contrib = org; var date = new Date(data.epoch*1000); - date.toString = function() {return this.toTimeString().slice(0,-15) +' '+ this.toLocaleDateString(); }; + //date.toString = function() {return this.toTimeString().slice(0,-15) +' '+ this.toLocaleDateString(); }; + date = date.getFullYear() + "-" + String(date.getMonth()).padStart(2, "0") + "-" + String(date.getDay()).padStart(2, "0") + "@" + String(date.getHours()).padStart(2, "0") + ":" + String(date.getMinutes()).padStart(2, "0"); var to_add = [ date, data.pnts, @@ -383,7 +384,8 @@ function addAwards(datatableAwards, json, playAnim) { var award = createTrophyImg(json.award[1][1], 40, categ); } var date = new Date(json.epoch*1000); - date.toString = function() {return this.toTimeString().slice(0,-15) +' '+ this.toLocaleDateString(); }; + //date.toString = function() {return this.toTimeString().slice(0,-15) +' '+ this.toLocaleDateString(); }; + date = date.getFullYear() + "-" + String(date.getMonth()).padStart(2, "0") + "-" + String(date.getDay()).padStart(2, "0") + "@" + String(date.getHours()).padStart(2, "0") + ":" + String(date.getMinutes()).padStart(2, "0"); var to_add = [ date, createImg(json.logo_path, 32),