Difference between revisions of "Template:Countdown"

From Dragalia Lost Wiki
Jump to navigation Jump to search
>Mornsta-gpuser
>Mornsta-gpuser
Line 1: Line 1:
 
<includeonly>{{#ifexpr:{{#time:U|now}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{{TimeStart|Now}}}}}}}|<div>Time Until Start: <span data-options="no-leading-zeros" 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></div>|<div>Time Remaining: <span data-options="no-leading-zeros" 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>{{#ifexpr:{{#time:U|now}}<{{#time:U|{{#time:F d, Y h:i:s A e|{{{TimeStart|Now}}}}}}}|<div>Time Until Start: <span data-options="no-leading-zeros" 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></div>|<div>Time Remaining: <span data-options="no-leading-zeros" 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>
<noinclude>[[Category:Templates]]</noinclude>
+
<noinclude>Parses EventName, StartDate and EndDate into a countdown, mostly used on [[event]] mentioning pages.
 +
 
 +
*Each event name must be unique, or the countdown end message will display for all countdowns once one end date is reached.
 +
*When start date 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.
 +
[[Category:Templates]]</noinclude>

Revision as of 13:32, 18 January 2019

Parses EventName, StartDate and EndDate into a countdown, mostly used on event mentioning pages.

  • Each event name must be unique, or the countdown end message will display for all countdowns once one end date is reached.
  • When start date 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.