Added display of datetime in last contributors

pull/3/head
Sami Mokaddem 2017-11-10 09:56:41 +01:00
parent d8ad176b72
commit 46d389c210
2 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,6 @@ optionDatatable_last.columnDefs = [
{ 'orderData':[6], 'targets': [0] }, { 'orderData':[6], 'targets': [0] },
{ {
'targets': [6], 'targets': [6],
'visible': false,
'searchable': false 'searchable': false
}, },
] ]
@ -305,14 +304,15 @@ function addLastFromJson(datatable, url) {
} }
function addLastContributor(datatable, data, update) { function addLastContributor(datatable, data, update) {
var date = new Date(data.epoch*1000);
var to_add = [ var to_add = [
date.toTimeString().slice(0,-15) +' '+ date.toLocaleDateString(),
data.pnts, data.pnts,
getMonthlyRankIcon(data.rank), getMonthlyRankIcon(data.rank),
getOrgRankIcon(data.orgRank, 60), getOrgRankIcon(data.orgRank, 60),
createHonorImg(data.honorBadge, 20), createHonorImg(data.honorBadge, 20),
createImg(data.logo_path, 32), createImg(data.logo_path, 32),
createOrgLink(data.org), createOrgLink(data.org),
data.epoch
]; ];
if (update == undefined || update == false) { if (update == undefined || update == false) {
datatable.row.add(to_add); datatable.row.add(to_add);
@ -398,7 +398,7 @@ function updateProgressHeader(org) {
}); });
datatableLast.rows().every( function() { datatableLast.rows().every( function() {
var row = this.node(); var row = this.node();
if(this.data()[5] == data.org) { row.classList.add('selectedOrgInTable'); } else { row.classList.remove('selectedOrgInTable'); } if(this.data()[6] == data.org) { row.classList.add('selectedOrgInTable'); } else { row.classList.remove('selectedOrgInTable'); }
}); });
}); });

View File

@ -263,13 +263,13 @@
<table id="lastTable" class="table table-hover table-striped"> <table id="lastTable" class="table table-hover table-striped">
<thead> <thead>
<tr> <tr>
<th>date/time</th>
<th>Points</th> <th>Points</th>
<th>Cur. rank</th> <th>Cur. rank</th>
<th>Org. rank</th> <th>Org. rank</th>
<th></th> <th></th>
<th></th> <th></th>
<th>Organisation</th> <th>Organisation</th>
<th>epoch</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>