This commit is contained in:
2025-11-21 16:44:51 -05:00
parent c4914a5ae9
commit 8414e1013d
6 changed files with 254 additions and 172 deletions

View File

@@ -62,25 +62,4 @@ document.addEventListener('DOMContentLoaded', () => {
}
})
.catch(error => console.error('Error loading footer:', error));
// --- 5. Fetch and Display Last Update from Gitea -----------------------
fetch('https://gitea.btcforplebs.com/api/v1/repos/btcforplebs/BTCforPlebs.com')
.then(response => response.json())
.then(data => {
const lastUpdate = new Date(data.updated_at);
const formattedDate = lastUpdate.toLocaleDateString();
const formattedTime = lastUpdate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const updateText = document.getElementById('last-updated-text');
if (updateText) {
updateText.textContent = `Website last updated: ${formattedDate} ${formattedTime}`;
}
})
.catch(error => {
console.error('Error fetching last update:', error);
const updateText = document.getElementById('last-updated-text');
if (updateText) {
updateText.textContent = 'Last update: Error fetching data.';
}
});
});