mirror of
https://codeberg.org/Comenius-Institut/AdventskalendOER.git
synced 2024-11-21 07:25:15 +00:00
tage-bis-weihnachten.md hinzugefügt
This commit is contained in:
parent
47df5fa9e5
commit
8262d6dec2
20
tage-bis-weihnachten.md
Normal file
20
tage-bis-weihnachten.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
## Tage bis Weihnachten:
|
||||
|
||||
Weihnachten:
|
||||
<script format="relativetime" unit="day" locale="de">
|
||||
// Datum von Weihnachten
|
||||
const christmasDate = new Date('2024-12-24');
|
||||
// Get the current time
|
||||
const currentDate = new Date();
|
||||
// Unterschied in Millisekunden berechnen
|
||||
const differenceInMs = currentDate - christmasDate;
|
||||
|
||||
// Millisekunden in Tage umwandeln
|
||||
const differenceInDays = differenceInMs / (1000 * 60 * 60 * 24);
|
||||
// Umrechnen in volle Tage
|
||||
const WeihnachtsCountdown = Math.floor(differenceInDays);
|
||||
|
||||
// Return result
|
||||
-WeihnachtsCountdown
|
||||
</script>
|
||||
!
|
Loading…
Reference in a new issue