Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| (10 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
<noinclude> | <noinclude> | ||
__NOTOC__ | __NOTOC__ | ||
{{#widget:ClubStatus}} | |||
</noinclude> | </noinclude><includeonly><script> | ||
<includeonly> | |||
<script> | |||
(() => { | (() => { | ||
const OPENED_CLASS = ' | const OPENED_CLASS = 'widget-clubstatus__type--opened'; | ||
const CLOSED_CLASS = ' | const CLOSED_CLASS = 'widget-clubstatus__type--closed'; | ||
const clubStatusMarker = document.querySelector(' | const clubStatusMarker = document.querySelector('#widget-clubstatus'); | ||
function setClubStatus(isOpen, lastChange) { | function setClubStatus(isOpen, lastChange) { | ||
| Zeile 24: | Zeile 20: | ||
} | } | ||
const lastChangeDateTimeString = (new Date(lastChange).toLocaleString('de-DE')); | const lastChangeDateTimeString = (new Date(lastChange * 1000).toLocaleString('de-DE')); | ||
clubStatusMarker.setAttribute('title', 'letzte Änderung: ' + lastChangeDateTimeString); | clubStatusMarker.setAttribute('title', 'letzte Änderung: ' + lastChangeDateTimeString); | ||
| Zeile 30: | Zeile 26: | ||
function updateClubStatus() { | function updateClubStatus() { | ||
fetch('api/entropia-club-status-json-api.php') | fetch('/api/entropia-club-status-json-api.php') | ||
.then(response => response.json()) | .then(response => response.json()) | ||
.then(data => setClubStatus(data[" | .then(data => setClubStatus(data["state"]["open"], data["state"]["lastchange"])); | ||
} | } | ||
| Zeile 39: | Zeile 35: | ||
updateClubStatus(); | updateClubStatus(); | ||
})(); | })(); | ||
</script> | </script></includeonly> | ||
</includeonly> | |||
Aktuelle Version vom 4. Januar 2026, 21:05 Uhr