Template:EventTimeLeft: Difference between revisions

From NOISZ Wiki
oldwiki>RiceEmpress
(moving the self null edit to when it starts - that way it can be included on the single event pages when they start)
 
mNo edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly><span class="countdown" data-end="stop" data-options="short-format" style="display:none;">Ends: <span class="countdowndate">{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</span></span></includeonly>
<includeonly><span class="countdown" data-end="stop" data-options="short-format" style="display:none;">Ends: <span class="countdowndate">{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</span></span>
{{#widget: CountdownTimer}}
</includeonly>
<noinclude>
<noinclude>
This details how much time left is on an event, according to the time between now and the next 2-week waypoint in the standard 10-week event cycle.</noinclude>
This details how much time left is on an event, according to the time between now and the next 2-week waypoint in the standard 10-week event cycle.
 
The countdown clocks for [[Template:EventTimeLeft|EventTimeLeft]] and [[Template:EventCountdown|EventCountdown]] use markers to count down to.
 
EventTimeLeft is the countdown clock itself, and is:
 
<nowiki><span class="countdown" data-end="stop" data-options="short-format" style="display:none;">Ends: <span class="countdowndate">{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</span></span>
{{#widget: CountdownTimer}}</nowiki>
 
The time it's counting down to is <nowiki>{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</nowiki>, which adds the seconds left in the 2-week cycle that is a single event to the current time in Unix (the amount of seconds elapsed since 1 January 1970), and then counts down to it.
 
This draws on the [[:Widget:CountdownTimer|CountdownTimer]] widget required to make the countdown timers actually work; "data-
[[Category:Templates]]
{{NOISZ Timer Flowchart}}
</noinclude>

Latest revision as of 20:15, 5 February 2026


This details how much time left is on an event, according to the time between now and the next 2-week waypoint in the standard 10-week event cycle.

The countdown clocks for EventTimeLeft and EventCountdown use markers to count down to.

EventTimeLeft is the countdown clock itself, and is:

<span class="countdown" data-end="stop" data-options="short-format" style="display:none;">Ends: <span class="countdowndate">{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</span></span> {{#widget: CountdownTimer}}

The time it's counting down to is {{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}, which adds the seconds left in the 2-week cycle that is a single event to the current time in Unix (the amount of seconds elapsed since 1 January 1970), and then counts down to it.

This draws on the CountdownTimer widget required to make the countdown timers actually work; "data-

Timer Templates

Template:EventCycleTime Module:CurrentNOISZSLEvent
Module:CurrentSyntheticEvent
Template:CurrentNoiszSLEvent
Template:CurrentSyntheticEvent
Template:EventTimeLeftUnix Template:EventTimeLeft Template:NOISZ SL Events
Template:NOISZ SL Events Vertical
Template:NOISZ SL Recursive Events
Template:NOISZ SL Synthetic Events
Template:EventTimeCountdownUnix Template:EventCountdown