From Dark and Darker Wiki
(Another typo) |
(Replacing static id element name) |
||
Line 15: | Line 15: | ||
var seconds = Math.floor((distance % (1000 * 60)) / 1000); | var seconds = Math.floor((distance % (1000 * 60)) / 1000); | ||
document.getElementById("timer").innerHTML = days + "d " + hours + "h " | document.getElementById("<!--{$uniqueId|default:'timer'|escape:'html'}-->").innerHTML = days + "d " + hours + "h " | ||
+ minutes + "m " + seconds + "s "; | + minutes + "m " + seconds + "s "; | ||
if (distance < 0) { | if (distance < 0) { | ||
clearInterval(x); | clearInterval(x); | ||
document.getElementById("timer").innerHTML = "LIVE NOW"; | document.getElementById("<!--{$uniqueId|default:'timer'|escape:'html'}-->").innerHTML = "LIVE NOW"; | ||
} | } | ||
}, 1000); | }, 1000); |
Revision as of 00:14, 26 August 2024
Parameters
uniqueId
- Determines element id name
- Name needs to be unique if multiple widgets are to be displayed on the same page.
- Default:
timer
date
- String of text indicating a date and time.
- Example:
2024-12-31 23:59:59
- Example:
Example 1
{{#widget:Countdown|uniqueId=Test1|date=2024-12-31 23:59:59}}
Example 2
{{#widget:Countdown|uniqueId=Test2|date=2024-12-31 23:59:59}}