Difference between revisions of "Template:Countdown"

From Arks-Visiphone
Jump to navigation Jump to search
(Created page with "<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-for...")
 
 
Line 1: Line 1:
<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>
+
<includeonly><div class="hidden"><!--
<noinclude>(Countdown) - Parses EventName, StartTime and EndTime into a countdown, mostly used on event mentioning pages.
+
-->{{#if:{{{TimeStart|}}}{{{TimeEnd|}}}<!--
 
+
-->|{{#iferror:{{#ifexpr:{{#time:U|{{{TimeStart|}}} {{{Offset|{{{TimeStartOffset|}}}}}}}}<{{#time:U|{{{TimeEnd|}}} {{{Offset|{{{TimeEndOffset|}}}}}}}}}}<!--
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.
+
-->||{{#ifexpr:{{#time:U|{{#time:F d, Y h:i:s A e|}}}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{#if:{{{TimeStart|}}}|{{{TimeStart}}} {{{Offset|{{{TimeStartOffset|}}}}}}|}}}}}}<!--
 
+
-->|{{#if:{{{Region|}}}|({{{Region}}})|}} Starts in: <!--
Example Usage:
+
--><span data-end="toggle" data-toggle="next" data-options="no-leading-zeros short-format" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{#if:{{{TimeStart|}}}|{{{TimeStart}}} {{{Offset|{{{TimeStartOffset|}}}}}}|}}}}</span></span><!--
<pre>
+
--><span style="display:none;">Event has started. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span><!--
{{Countdown
+
-->|{{#ifexpr:{{#time:U|{{#time:F d, Y h:i:s A e|}}}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{#if:{{{TimeEnd|}}}|{{{TimeEnd}}} {{{Offset|{{{TimeEndOffset|}}}}}}|}}}}}}|{{#if:{{{Region|}}}|({{{Region}}})|}} Ends in: <!--
|EventName=Season 1
+
--><span data-end="toggle" data-toggle="next" data-options="no-leading-zeros short-format" class="countdown" style="display:none;"><span class="countdowndate" style="font-weight:bold">{{#time:F d, Y h:i:s A e|{{#if:{{{TimeEnd|}}}|{{{TimeEnd}}} {{{Offset|{{{TimeEndOffset|}}}}}}|}}}}</span></span><!--
|StartTime=16.9.2020 14:59:59 +0900
+
--><span style="display:none;">Event has concluded. <small>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge page]</small></span>|}}<!--
|EndTime=14.10.2020 14:59:59 +0900
+
-->}}<!--
}}
+
-->}}<!--
</pre>
+
-->|}}<!--
 
+
--></div></includeonly><!--
Example Output:
+
--><noinclude>{{documentation}}</noinclude>
{{Countdown
 
|EventName=Season 1
 
|StartTime=16.9.2020 14:59:59 +0900
 
|EndTime=14.10.2020 14:59:59 +0900
 
}}
 
 
 
*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.
 
[[Category:Templates]]</noinclude>
 

Latest revision as of 19:26, 8 May 2021