sort leases by expires

This commit is contained in:
Oscar Krause 2023-01-03 21:29:32 +01:00
parent ca96ae08a7
commit f199800040

View File

@ -70,7 +70,7 @@ async function fetchLeases(element) {
</tr>`
table.appendChild(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');
row.innerHTML = `
<td><code>${o.lease_ref}</code></td>