Difference between revisions of "Template:Countdown"
imported>Maihuongly (Undid revision 794702227 by Maihuongly (talk)) |
imported>Maihuongly |
||
| Line 1: | Line 1: | ||
| − | {{# | + | <includeonly>{|class="toccolours" style="float:right;clear:right;margin:0 0 1em 1em; padding:6px; font-size:90%;width:22em;" |
| + | |style="background: #dadada; text-align: center;font-size:110%"|'''{{{name}}}''' | ||
| + | |- | ||
| + | |style="text-align: center;" align="center"|{{#if:{{{logo|}}} | ||
| + | |{{{logo}}} | ||
| + | | | ||
| + | }} | ||
| + | |- | ||
| + | |style="text-align: center;"|{{{place}}} – {{{year}}}-{{{month}}}-{{{day}}} | ||
| + | |- | ||
| + | |style="text-align:center;font-size:400%;line-height:100%"|'''{{#ifexpr: ( {{#time:U}} - {{#time:U|{{{day}}}-{{{month}}}-{{{year}}} -{{{utc_offset}}}}} ) < 0 | ||
| + | | | ||
| + | <span style="font-size:0.3em">Forward<small> </small></span><span style="color: #dc5b37;">{{#expr: -( {{#time:U}} - {{#time:U|{{{day}}}-{{{month}}}-{{{year}}} -{{{utc_offset}}} }} ) / 86400 +0.5 round 0}}</span><span style="font-size:0.3em">days</span> | ||
| + | | | ||
| + | {{#ifexpr: ( {{#time:U}} - {{#time:U|{{{day}}}-{{{month}}}-{{{year}}} -{{{utc_offset}}} }}- 86400 ) < 0 | ||
| + | |<!--Day --> | ||
| + | <span style="font-size:0.5em">{{#if:{{{day display|}}} | ||
| + | |{{{day display}}} | ||
| + | |start | ||
| + | }}</span> | ||
| + | |<!-- After the Opening day --> | ||
| + | <span style="font-size:0.5em">{{#if:{{{last next day display|}}} | ||
| + | |{{{last day display}}} | ||
| + | |end | ||
| + | }}</span> | ||
| + | }} | ||
| + | }}''' | ||
| + | |- | ||
| + | |style="color: grey; text-align: center;"|Local time<br/><small>({{Purge|Refresh}})</small> | ||
| + | |} | ||
| + | </includeonly> | ||
| + | |||
{{documentation}} | {{documentation}} | ||
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> | <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> | ||
</noinclude> | </noinclude> | ||
Revision as of 15:36, 9 August 2017
| 30px | This template uses Lua: |
Notes
Please note the following important points before using this template.
The time on this countdown clock is GMT (UTC+0)
- if the event is held in more than a year, the number of years and everything below will be shown
- if the event is held in more than a week, the number of weeks and everything below will be shown
- if the event is held in more than 24 hours, the number of days and everything below will be shown
- if the event is held within 24 hours, the number of hours left and everything below will be shown
- if the event is held within 1 hour, the number of minutes left and the number of seconds left will be shown
- if the event is held within 1 minute, the number of seconds left will be shown
Duration is in seconds, so duration=3600 for a one-hour event. Alternatively, duration and duration unit=//unit// can be used in unison (e.g., duration=1|duration unit=year).
This template should not be used in articles per MOS:TIME and MOS:DATED.
Usage
Editors can use this template as a countdown clock for a lot of different events. The following can show you how to use this template.
Simple Countdown Clock
This type of countdown clock is suitable for events with no duration.
{{countdown
|year = 2020
|month = 04
|day = 15
|event = Branch Network Awards Night
}}
If you type in the above, something like the following will appear.
| {{{name}}} |
| {{{place}}} – 2020-04-15 |
| Expression error: Unexpected < operator. |
| Local time (Script error: No such module "Purge".) |
Template loop detected: Template:Documentation
</noinclude>
Advanced Countdown Clock
This type of countdown clock is suitable for events with a duration.
{{countdown
|year = 2022
|month = 4
|day = 15
|hour = 19
|minute = 40
|second = 0
|event =
|duration = 21
|eventstart = unknown has started
|eventend = unknown has ended
}}
If you type in the above, something like the following will appear.
| {{{name}}} |
| {{{place}}} – 2022-4-15 |
| Expression error: Unexpected < operator. |
| Local time (Script error: No such module "Purge".) |
Template loop detected: Template:Documentation
</noinclude>
No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Year | year | no description | Unknown | optional |
| Month | month | no description | Unknown | optional |
| Day | day | no description | Unknown | optional |
| Hour | hour | no description | Unknown | optional |
| Minute | minute | no description | Unknown | optional |
| Second | second | no description | Unknown | optional |
| Event | event | no description | Unknown | optional |
| Duration | duration | no description | Unknown | optional |
| Eventstart | eventstart | no description | Unknown | optional |
| Eventend | eventend | no description | Unknown | optional |
| The above documentation is transcluded from Template:Countdown/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |