Template:Countdown: Difference between revisions
From Pengwings
Created page with "Displays a countdown to the specified time, updated by javascript in MediaWiki:Gadget-timer.js. Parameters: ;time : UTC time to count down to, in YYYY-MM-DD HH:MM format, e.g. 2001-02-03 04:05 for 5 minutes past 4am on February 3rd, 2001. ;expired : Text to display instead of the countdown if the specified time is already in the past. ;intro : (Optional) Text introducing the countdown. ;class : (Optional) CSS classes to apply to the outer container. ;hide-days : (Op..." |
No edit summary |
||
| Line 4: | Line 4: | ||
;time : UTC time to count down to, in YYYY-MM-DD HH:MM format, e.g. 2001-02-03 04:05 for 5 minutes past 4am on February 3rd, 2001. | ;time : UTC time to count down to, in YYYY-MM-DD HH:MM format, e.g. 2001-02-03 04:05 for 5 minutes past 4am on February 3rd, 2001. | ||
;expired : Text to display instead of the countdown if the specified time is already in the past. | ;expired : Text to display instead of the countdown if the specified time is already in the past. | ||
;since : set to 1 to make this a count-up instead of a countdown | |||
;intro : (Optional) Text introducing the countdown. | ;intro : (Optional) Text introducing the countdown. | ||
;class : (Optional) CSS classes to apply to the outer container. | ;class : (Optional) CSS classes to apply to the outer container. | ||
| Line 11: | Line 12: | ||
Script/template designed by [[User:Pcj]] from https://warcraft.wiki.gg/wiki/MediaWiki:Common.js | Script/template designed by [[User:Pcj]] from https://warcraft.wiki.gg/wiki/MediaWiki:Common.js | ||
<onlyinclude><div class="jst-countdown {{{class|}}}" style="text-align:center; {{{style|}}}" data-jst-time="{{{time|2020-01-01 01:01}}}" data-jst-text-over="{{{expired|}}}">{{#if:{{{intro|}}}|<div style="padding: 0 0 2ex 0">{{{intro}}}</div>}} | <onlyinclude><div class="jst-countdown {{{class|}}}" style="text-align:center; {{{style|}}}" data-jst-since="{{{since|0}}}" data-jst-time="{{{time|2020-01-01 01:01}}}" data-jst-text-over="{{{expired|}}}">{{#if:{{{intro|}}}|<div style="padding: 0 0 2ex 0">{{{intro}}}</div>}} | ||
{{#ifeq:{{{hide-days}}}|yes||<div class="jst-days" style="display: inline-block; {{{digit-style|width: 5em}}}"><div class="jst-value" style="{{{digit-value-style|font-size: 2em}}}"></div><div class="jst-label" style="text-align: center; {{{digit-label-style|}}}"></div></div>}} | {{#ifeq:{{{hide-days}}}|yes||<div class="jst-days" style="display: inline-block; {{{digit-style|width: 5em}}}"><div class="jst-value" style="{{{digit-value-style|font-size: 2em}}}"></div><div class="jst-label" style="text-align: center; {{{digit-label-style|}}}"></div></div>}} | ||
<div class="jst-hours" style="display: inline-block; {{{digit-style|width: 5em}}}"><div class="jst-value" style="{{{digit-value-style|font-size: 2em}}}"></div><div class="jst-label" style="text-align: center; {{{digit-label-style|}}}"></div></div> | <div class="jst-hours" style="display: inline-block; {{{digit-style|width: 5em}}}"><div class="jst-value" style="{{{digit-value-style|font-size: 2em}}}"></div><div class="jst-label" style="text-align: center; {{{digit-label-style|}}}"></div></div> | ||
Revision as of 13:45, 16 February 2026
Displays a countdown to the specified time, updated by javascript in MediaWiki:Gadget-timer.js.
Parameters:
- time
- UTC time to count down to, in YYYY-MM-DD HH:MM format, e.g. 2001-02-03 04:05 for 5 minutes past 4am on February 3rd, 2001.
- expired
- Text to display instead of the countdown if the specified time is already in the past.
- since
- set to 1 to make this a count-up instead of a countdown
- intro
- (Optional) Text introducing the countdown.
- class
- (Optional) CSS classes to apply to the outer container.
- hide-days
- (Optional) If "yes" is passed, only hours/minutes/seconds will be displayed.
- style, digit-style, digit-value-style, digit-label-style
- (Optional) CSS styles to apply to the outer container, days/hours/minutes/seconds containers, displayed numbers, and labels respectively.
Script/template designed by User:Pcj from https://warcraft.wiki.gg/wiki/MediaWiki:Common.js