sort leases by expires

This commit is contained in:
Oscar Krause 2023-01-03 21:29:32 +01:00
parent 02b2d5cbe8
commit 2c9e8a8b0b

View File

@ -70,7 +70,7 @@ async function fetchLeases(element) {
</tr>` </tr>`
table.appendChild(thead) table.appendChild(thead)
let tbody = document.createElement('thead'); let tbody = document.createElement('thead');
x.forEach((o) => { x.sort((a, b) => new Date(a.lease_expires) - new Date(b.lease_expires)).forEach((o) => {
let row = document.createElement('tr'); let row = document.createElement('tr');
row.innerHTML = ` row.innerHTML = `
<td><code>${o.lease_ref}</code></td> <td><code>${o.lease_ref}</code></td>