modified: web/static/js/main.js
modified: web/templates/404.html modified: web/templates/base.html modified: web/templates/group_admin/base.html modified: web/templates/group_admin/member_edit.html modified: web/templates/group_admin/members.html
This commit is contained in:
@@ -24,6 +24,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
updateOnlineCount();
|
||||
setInterval(updateOnlineCount, 30_000);
|
||||
|
||||
// Client-side clock: always use the user's local PC/browser time
|
||||
initClientClock();
|
||||
|
||||
// Tooltips initialisieren
|
||||
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => {
|
||||
new bootstrap.Tooltip(el);
|
||||
@@ -33,6 +36,27 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
initTableSort();
|
||||
});
|
||||
|
||||
function initClientClock() {
|
||||
const el = document.getElementById('client-clock');
|
||||
if (!el) return;
|
||||
|
||||
const render = () => {
|
||||
const now = new Date();
|
||||
const locale = navigator.language || 'en-US';
|
||||
el.textContent = now.toLocaleString(locale, {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
render();
|
||||
setInterval(render, 1000);
|
||||
}
|
||||
|
||||
// ── Online-Count API ──────────────────────────────────────
|
||||
function updateOnlineCount() {
|
||||
fetch('/api/online')
|
||||
|
||||
Reference in New Issue
Block a user