function formatDate(dateStr) { const d = new Date(dateStr); return d.toLocaleDateString('fr-FR', { year: 'numeric', month: 'long', day: 'numeric' }); } function concertTemplate(c) { return `
${escapeHtml(c.name || 'Concert')}
${escapeHtml(c.venue || '')} · ${formatDate(c.concert_date)}
`; } function showError(message) { document.getElementById('error').innerHTML = `
${escapeHtml(message)}
`; } (async function init() { await initNav('history'); try { const history = await api.get('/api/setlists/history'); renderList(document.getElementById('history-list'), history, concertTemplate, 'Aucun concert passé enregistré.'); } catch (err) { showError(err.message); } })();