fix: [js] Contributors dates will now look: 2019-04-03@11:03 - Amend … (#101)

fix: [js] Contributors dates will now look: 2019-04-03@11:03 - Amend …
fixlogs
Steve Clement 2019-06-02 04:00:14 +02:00 committed by GitHub
commit ca0bfe6356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -83,7 +83,7 @@ class LogItem():
def get_row(self): def get_row(self):
to_ret = {} 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)): for item in range(len(LogItem.FIELDNAME_ORDER)):
try: try:
to_ret[item] = self.fields[item] to_ret[item] = self.fields[item]

View File

@ -346,7 +346,8 @@ function addLastContributor(datatable, data, update) {
} else { } else {
last_added_contrib = org; last_added_contrib = org;
var date = new Date(data.epoch*1000); 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 = [ var to_add = [
date, date,
data.pnts, data.pnts,
@ -383,7 +384,8 @@ function addAwards(datatableAwards, json, playAnim) {
var award = createTrophyImg(json.award[1][1], 40, categ); var award = createTrophyImg(json.award[1][1], 40, categ);
} }
var date = new Date(json.epoch*1000); 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 = [ var to_add = [
date, date,
createImg(json.logo_path, 32), createImg(json.logo_path, 32),