MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
No edit summary |
No edit summary |
||
| Line 102: | Line 102: | ||
const rows = Array.from(table.querySelectorAll("tr")); | const rows = Array.from(table.querySelectorAll("tr")); | ||
if (rows.length <= 1) return; | if (rows.length <= 1) return; | ||
| Line 117: | Line 115: | ||
} | } | ||
// | // Time column is now index 4 | ||
dataRows.sort((a, b) => { | dataRows.sort((a, b) => { | ||
const timeA = parseTime(a.cells[ | const timeA = parseTime(a.cells[4].innerText); | ||
const timeB = parseTime(b.cells[ | const timeB = parseTime(b.cells[4].innerText); | ||
return timeA - timeB; | return timeA - timeB; | ||
}); | }); | ||
dataRows.forEach(row => table.appendChild(row)); | dataRows.forEach(row => table.appendChild(row)); | ||
dataRows.forEach((row, index) => { | dataRows.forEach((row, index) => { | ||
const rankCell = row.cells[0]; | const rankCell = row.cells[0]; | ||