Main Page

Difference between revisions of "Template:Countdown"

From Arks-Visiphone
Jump to navigation Jump to search
Line 1: Line 1:
<includeonly><div>{{#ifexpr:{{#time:U|now+9 hours}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{{TimeStart|Now}}}}}}}|Time Until Start: <span data-options="no-leading-zeros short-format" data-end="toggle" data-toggle=".post-countdown1{{{EventName}}}" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{{TimeStart}}}}}</span></span><span class="post-countdown1{{{EventName}}}" style="display:none;">Event has started. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span>|Time Remaining: <span data-options="no-leading-zeros short-format" data-end="toggle" data-toggle=".post-countdown2{{{EventName}}}" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{{TimeEnd}}}}}</span></span><span class="post-countdown2{{{EventName}}}" style="display:none;">Event has concluded. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span>}}</div></includeonly>
+
<includeonly><div>{{#ifexpr:{{#time:U|now+9 hours}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{{StartTime|Now}}}}}}}|Time Until Start: <span data-options="no-leading-zeros short-format" data-end="toggle" data-toggle=".post-countdown1{{{EventName}}}" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{{StartTime}}}}}</span></span><span class="post-countdown1{{{EventName}}}" style="display:none;">Event has started. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span>|Time Remaining: <span data-options="no-leading-zeros short-format" data-end="toggle" data-toggle=".post-countdown2{{{EventName}}}" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{{EndTime}}}}}</span></span><span class="post-countdown2{{{EventName}}}" style="display:none;">Event has concluded. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span>}}</div></includeonly>
<noinclude>(Countdown) - Parses EventName, TimeStart and TimeEnd into a countdown, mostly used on event mentioning pages.
+
<noinclude>(Countdown) - Parses EventName, StartTime and EndTime into a countdown, mostly used on event mentioning pages.
  
 
This template works with a JavaScript snippet that can be found either in this wiki's common.js or a gadget. It does NOT use the countdown extension.
 
This template works with a JavaScript snippet that can be found either in this wiki's common.js or a gadget. It does NOT use the countdown extension.
Line 8: Line 8:
 
{{Countdown
 
{{Countdown
 
|EventName=SecretPhraseMay15th2020
 
|EventName=SecretPhraseMay15th2020
|TimeStart=May 15 2020 15:00 +0900
+
|StartTime=May 15 2020 15:00 +0900
|TimeEnd=June 4 2020 23:59 +0900
+
|EndTime=June 4 2020 23:59 +0900
 
}}
 
}}
 
</pre>
 
</pre>
Line 16: Line 16:
 
{{Countdown
 
{{Countdown
 
|EventName=SecretPhraseMay15th2020
 
|EventName=SecretPhraseMay15th2020
|TimeStart=May 15 2020 15:00 +0900
+
|StartTime=May 15 2020 15:00 +0900
|TimeEnd=June 4 2020 23:59 +0900
+
|EndTime=June 4 2020 23:59 +0900
 
}}
 
}}
  
*Each EventName must be unique, or the countdown end message will display for all countdowns once one TimeEnd is reached.
+
*Each EventName must be unique, or the countdown end message will display for all countdowns once one EndTime is reached.
*When TimeStart has been reached, the countdown will show "Event has started" and provide a link to purge the page (the user can alternatively refresh).
+
*When StartTime has been reached, the countdown will show "Event has started" and provide a link to purge the page (the user can alternatively refresh).
*If |TimeStart is not included in the template call, the template will automatically use Now as a placeholder time, and will skip the Time Until Start portion and go into the Time remaining portion.
+
*If |StartTime is not included in the template call, the template will automatically use Now as a placeholder time, and will skip the Time Until Start portion and go into the Time remaining portion.
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 10:08, 14 October 2020

(Countdown) - Parses EventName, StartTime and EndTime into a countdown, mostly used on event mentioning pages.

This template works with a JavaScript snippet that can be found either in this wiki's common.js or a gadget. It does NOT use the countdown extension.

Example Usage:

{{Countdown
|EventName=SecretPhraseMay15th2020
|StartTime=May 15 2020 15:00 +0900
|EndTime=June 4 2020 23:59 +0900
}}

Example Output:

Time Remaining:


  • Each EventName must be unique, or the countdown end message will display for all countdowns once one EndTime is reached.
  • When StartTime has been reached, the countdown will show "Event has started" and provide a link to purge the page (the user can alternatively refresh).
  • If |StartTime is not included in the template call, the template will automatically use Now as a placeholder time, and will skip the Time Until Start portion and go into the Time remaining portion.