This commit is contained in:
2026-01-21 22:55:24 +01:00
parent 326c43b339
commit eee375c016

View File

@@ -9,6 +9,17 @@ function esc(s = '') {
.replace(/'/g, '''); .replace(/'/g, ''');
} }
function formatVersionDate(value) {
if (!value) return '';
try {
const date = new Date(value);
if (Number.isNaN(date.getTime())) return value;
return date.toLocaleString('de-DE');
} catch {
return value;
}
}
function normalizeApiName(v = '') { function normalizeApiName(v = '') {
return String(v) return String(v)
.trim() .trim()
@@ -225,8 +236,9 @@ export async function loadList(section) {
selectEl.disabled = false; selectEl.disabled = false;
items.forEach(item => { items.forEach(item => {
const opt = document.createElement('option'); const opt = document.createElement('option');
const label = `#${item.version_no} ${formatVersionDate(item.created_at)}` + (Number(item.is_active) === 1 ? ' (aktiv)' : '');
opt.value = String(item.id); opt.value = String(item.id);
opt.textContent = `#${item.version_no}` + (Number(item.is_active) === 1 ? ' (aktiv)' : ''); opt.textContent = label;
selectEl.appendChild(opt); selectEl.appendChild(opt);
}); });
if (activeId) selectEl.value = activeId; if (activeId) selectEl.value = activeId;