|
|
| (One intermediate revision by the same user not shown) |
| Line 1: |
Line 1: |
| <includeonly>{{ | | <includeonly>{{#if: {{{countdown|}}} | <span class="countdown" data-options="short-format" style="display:none;" data-end="callback" data-callback="selfNullEdit">Starts: <span class="countdowndate">{{#time:F d, Y H:i T|@{{#expr:{{EventTimeCountdownUnix|cyclestart={{{cyclestart|}}}|eventstyle={{{eventstyle|LUNATIC MAINFRAME}}}}} + {{#time:U|now}}}}}}</span></span> | Starts: {{#time:F d, Y H:i T|@{{#expr:{{EventTimeCountdownUnix|cyclestart={{{cyclestart|}}}|eventstyle={{{eventstyle|LUNATIC MAINFRAME}}}}} + {{#time:U|now}}}}}} |
| #if: {{{ start | }}} | | }}</includeonly> |
| | {{ | | <noinclude> |
| #vardefine: utc_timestamp_start | {{#time: U | {{{ start | }}} }}
| | This counts down the time until the recurrent event for a given style, and gives a differing output format depending on how many parameters are input. |
| }}{{
| | |
| #vardefine: utc_timestamp_end | {{#time: U | {{{ end | }}} }}
| | Example: |
| }}
| | |
| | {{
| | <code><nowiki>{{EventCountdown}}</nowiki></code> |
| #vardefine: utc_timestamp_start | {{#time: U | {{{ 1 | }}} }}
| | |
| }}{{
| | {{EventCountdown}} |
| #vardefine: utc_timestamp_end | {{ #var: utc_timestamp_start }}
| | [[Category:Templates]] |
| }}
| |
| }}{{
| |
| #vardefine: jst_timestamp_start | {{ #expr: {{ #var: utc_timestamp_start }} + (9 * 60 * 60) }}
| |
| }}{{ | |
| #vardefine: jst_timestamp_end | {{ #expr: {{ #var: utc_timestamp_end }} + (9 * 60 * 60) }}
| |
| }}{{
| |
| #vardefine: utc_display_start | {{#time: H:i "UTC", F j, Y | @{{ #var: utc_timestamp_start }} }}
| |
| }}{{ | |
| #vardefine: jst_display_start | {{#time: H:i "JST", F j, Y | @{{ #var: jst_timestamp_start }} }}
| |
| }}{{
| |
| #vardefine: utc_display_end | {{#time: H:i "UTC", F j, Y | @{{ #var: utc_timestamp_end }} }}
| |
| }}{{
| |
| #vardefine: jst_display_end | {{#time: H:i "JST", F j, Y | @{{ #var: jst_timestamp_end }} }}
| |
| }}{{
| |
| #widget:EventCountdown
| |
| |text={{{text|Ends in}}}
| |
| |expired={{{expired|Event has ended.}}} | |
| |utc={{ #var: utc_timestamp_start }}
| |
| |jst={{ #var: jst_timestamp_start }} | |
| |utc_time={{ #var: utc_display_start }}
| |
| |jst_time={{ #var: jst_display_start }} | |
| |text_start={{{text_start|Starts in}}}
| |
| |text_end ={{{text_end|{{{text|Ends in}}}}}}
| |
| |text_after={{{text_after|{{{expired|Event has ended.}}}}}}
| |
| |utc_start={{ #var: utc_timestamp_start }}
| |
| |utc_end ={{ #var: utc_timestamp_end }}
| |
| |jst_start={{ #var: utc_timestamp_start }}
| |
| |jst_end ={{ #var: utc_timestamp_end }}
| |
| |utc_display_start={{ #var: utc_display_start }}
| |
| |utc_display_end ={{ #var: utc_display_end }} | |
| |jst_display_start={{ #var: jst_display_start }}
| |
| |jst_display_end ={{ #var: jst_display_end }}
| |
| }}</includeonly><noinclude> | |
| == Test ==
| |
| {{EventCountdown|2026-07-20 17:00}}<br />
| |
| {{EventCountdown|2026-08-31 03:00 JST|text=Party in}}<br />
| |
| {{EventCountdown|2026-03-31 20:59 JST}}<br /> | |
| {{EventCountdown|2025-03-31 20:59 JST|expired=Magnafest has ended.}}<br />
| |
| {{EventCountdown|start=2025-12-18 01:30 JST|end=2017-12-18 19:30 JST}}<br />
| |
| {{EventCountdown|start=2018-12-18 02:30 JST|end=2017-12-18 20:30 JST}}<br /> | |
| {{EventCountdown|start=2018-12-18 03:30 JST|end=2017-12-18 21:30 JST}}<br />
| |
| </noinclude> | | </noinclude> |
| | {{ #widget: CountdownTimer }} |