From Dark and Darker Wiki

(Created page with "<includeonly> <span id="timer"></span> <script> function setIntOnStart(func, interval) { func(); return setInterval(func, interval); } var countDownDate = new Date('<!--{$date|escape:'quotes'}-->').getTime(); var x = setIntOnStart( _ => { var now = new Date().getTime(); var distance = countDownDate - now; var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes =...")
 
(Testing id element name)
Line 1: Line 1:
<includeonly>
<includeonly>
<span id="timer"></span>
<span id="timer'<!--{$uniqueId|default:''|escape:'quotes'}-->'"></span>
<script>
<script>
function setIntOnStart(func, interval) {
function setIntOnStart(func, interval) {
Line 24: Line 24:
}, 1000);
}, 1000);
</script>
</script>
</includeonly>
</includeonly><noinclude>
==Parameters==
<pre style="width:fit-content">uniqueId</pre>
*Determines element id name
*Name needs to be unique if multiple widgets are to be displayed on the same page.
*Default: <code>timer</code>
<pre style="width:fit-content">date</pre>
*String of text indicating a date and time.
**Example:<code>2024-12-31 23:59:59</code>
 
 
==Example 1==
<pre>{{#widget:Countdown|unqiueID=Test|date=2024-12-31 23:59:59}}</pre>
{{#widget:Countdown|unqiueID=Test|date=2024-12-31 23:59:59}}
==Example 2==
<pre>{{#widget:Countdown|unqiueID=Test|date=2024-12-31 23:59:59}}</pre>
{{#widget:Countdown|unqiueID=Test|date=2024-12-31 11:59:59}}
</noinclude>

Revision as of 00:04, 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 1

{{#widget:Countdown|unqiueID=Test|date=2024-12-31 23:59:59}}

Example 2

{{#widget:Countdown|unqiueID=Test|date=2024-12-31 23:59:59}}