Template:Countdown

From Love and Deepspace Wiki
Revision as of 21:51, 1 February 2024 by Elaeagnifolia (talk | contribs) (Created page with "<includeonly>{{#vardefine:timeStart|{{#expr:{{#time:U|{{#time:F d, Y h:i:s A e|{{{TimeStart|Now}}}}}}}-(3600*{{{timeZone|0}}})}}}}<!-- -->{{#vardefine:timeEnd|{{#expr:{{#time:U|{{#time:F d, Y h:i:s A e|{{{TimeEnd}}}}}}}-(3600*{{{timeZone|0}}})}}}}<!-- --><div>{{#ifexpr:{{#time:U|now}}<{{#time:U|{{#time:F d, Y h:i:s A e|@{{#var:timeStart}}}}}} |Begins in: <span data-options="no-leading-zeros short-format" data-end="toggle" data-toggle=".post-countdown1{{{EventName}}}" cla...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(Countdown) - Parses EventName, TimeStart and TimeEnd 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.

  • Each EventName must be unique, or the countdown end message will display for all countdowns once one TimeEnd 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).
  • 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.