Jump to content

Editing Template:Countdown/doc

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{JS|Gadget-Countdown}}
{{See also|Template:Countdownall}}
{{See also|Template:Countdownall}}
== Parameters ==
== Parameters ==
Line 66: Line 65:


==Examples==
==Examples==
{{Scrollbox|
<div class="mw-collapsible mw-collapsed">
===Case: Offset===
==Case: Offset==
<pre>
<pre>
{{Countdown
{{Countdown
Line 74: Line 73:
|TimeStart=2024/01/15 23:00:00
|TimeStart=2024/01/15 23:00:00
|TimeStartOffset=GMT+8
|TimeStartOffset=GMT+8
|TimeEnd=2050/01/31 03:59:59
|TimeEnd=2025/01/31 03:59:59
|TimeEndOffset=GMT+8
|TimeEndOffset=GMT+8
}}
}}
Line 83: Line 82:
|TimeStart=2024/01/15 23:00:00
|TimeStart=2024/01/15 23:00:00
|TimeStartOffset=GMT+8
|TimeStartOffset=GMT+8
|TimeEnd=2050/01/31 03:59:59
|TimeEnd=2025/01/31 03:59:59
|TimeEndOffset=GMT+8
|TimeEndOffset=GMT+8
}}
}}
===Case: Upcoming===
==Case: Upcoming==
<pre>
<pre>
{{Countdown
{{Countdown
|Region=AS
|Region=AS
|EventName=TemplateExample1
|EventName=TemplateExample1
|TimeStart=2050/01/15 23:00:00 GMT+8
|TimeStart=2025/01/15 23:00:00 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}
}}
Line 98: Line 97:
|Region=AS
|Region=AS
|EventName=TemplateExample1
|EventName=TemplateExample1
|TimeStart=2050/01/15 23:00:00 GMT+8
|TimeStart=2025/01/15 23:00:00 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}
}}
===Case: Started===
==Case: Started==
<pre>
<pre>
{{Countdown
{{Countdown
Line 107: Line 106:
|EventName=TemplateExample2
|EventName=TemplateExample2
|TimeStart=2021-01-8 10:00:00 GMT+8
|TimeStart=2021-01-8 10:00:00 GMT+8
|TimeEnd=2050-01-31 03:59:59 GMT+8
|TimeEnd=2025-01-31 03:59:59 GMT+8
}}
}}
</pre>
</pre>
Line 114: Line 113:
|EventName=TemplateExample2
|EventName=TemplateExample2
|TimeStart=2021-01-8 10:00:00 GMT+8
|TimeStart=2021-01-8 10:00:00 GMT+8
|TimeEnd=2050-01-31 03:59:59 GMT+8
|TimeEnd=2025-01-31 03:59:59 GMT+8
}}
}}
===Case: Long Ended===
==Case: Long Ended==
<pre>
<pre>
{{Countdown
{{Countdown
Line 131: Line 130:
|TimeEnd=2020-01-31 03:59:59 GMT+8
|TimeEnd=2020-01-31 03:59:59 GMT+8
}}
}}
===Case: Blank Start===
==Case: Blank Start==
<pre>
<pre>
{{Countdown
{{Countdown
Line 144: Line 143:
|EventName=TemplateExample4
|EventName=TemplateExample4
|TimeStart=
|TimeStart=
|TimeEnd=2050-01-31 03:59:59 GMT+8
|TimeEnd=2025-01-31 03:59:59 GMT+8
}}
}}
===Case: Blank Start Ended===
==Case: Blank Start Ended==
<pre>
<pre>
{{Countdown
{{Countdown
Line 161: Line 160:
|TimeEnd=2020-01-31 03:59:59 GMT+8
|TimeEnd=2020-01-31 03:59:59 GMT+8
}}
}}
===Case: Blank End===
==Case: Blank End==
<pre>
<pre>
{{Countdown
{{Countdown
Line 173: Line 172:
|Region=AS
|Region=AS
|EventName=TemplateExample5
|EventName=TemplateExample5
|TimeStart=2050-01-31 03:59:59 GMT+8
|TimeStart=2025-01-31 03:59:59 GMT+8
|TimeEnd=
|TimeEnd=
}}
}}
===Case: Blank End Started===
==Case: Blank End Started==
<pre>
<pre>
{{Countdown
{{Countdown
Line 191: Line 190:
|TimeEnd=
|TimeEnd=
}}
}}
===Case: Invalid Start===
==Case: Invalid Start==
<pre>
<pre>
{{Countdown
{{Countdown
Line 197: Line 196:
|EventName=TemplateExample6
|EventName=TemplateExample6
|TimeStart=aaaaaaaaaaaa
|TimeStart=aaaaaaaaaaaa
|TimeEnd=2050/01/31 03:59:59 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}
}}
</pre>
</pre>
Line 204: Line 203:
|EventName=TemplateExample6
|EventName=TemplateExample6
|TimeStart=aaaaaaaaaaaa
|TimeStart=aaaaaaaaaaaa
|TimeEnd=2050/01/31 03:59:59 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}
}}
===Case: Invalid End===
==Case: Invalid End==
<pre>
<pre>
{{Countdown
{{Countdown
Line 221: Line 220:
|TimeEnd=aaaaaaaaaaaa
|TimeEnd=aaaaaaaaaaaa
}}
}}
===Case: Invalid Start End===
==Case: Invalid Start End==
<pre>
<pre>
{{Countdown
{{Countdown
Line 236: Line 235:
|TimeEnd=aaaaaaaaaaaa
|TimeEnd=aaaaaaaaaaaa
}}
}}
===Case: Blank===
==Case: Blank==
<pre>
<pre>
{{Countdown
{{Countdown
Line 251: Line 250:
|TimeEnd=
|TimeEnd=
}}
}}
}}
</div>
{{clr}}
{{clr}}
==General Info==
==General Info==
(Countdown) - Parses EventName, TimeStart and TimeEnd into a countdown, mostly used on event mentioning pages.
(Countdown) - Parses EventName, TimeStart and TimeEnd into a countdown, mostly used on event mentioning pages.


*This template works with a JavaScript snippet imported from the [https://dev.fandom.com/wiki/Countdown developer's wiki] into this wiki's [[MediaWiki:ImportJS]]. It does NOT use the countdown extension.
*Utilizes the [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions parser functions] <nowiki>{{#time:F d, Y h:i:s A e|}} and {{#time:F d, Y|}}</nowiki> and is thus able to accept a variety of formats which are parsed and stored internally as UTC.
*Utilizes the [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions parser functions] <nowiki>{{#time:F d, Y h:i:s A e|}} and {{#time:F d, Y|}}</nowiki> and is thus able to accept a variety of formats which are parsed and stored internally as UTC.
*The following are accepted: backslashes (2019/1/1), dashes (2019-1-1), most manner of timezones (+9, +9 hours. +0930, JST, GMT +9) and commas in the correct spacing (November 20, 2019).
*The following are accepted: backslashes (2019/1/1), dashes (2019-1-1), most manner of timezones (+9, +9 hours. +0930, JST, GMT +9) and commas in the correct spacing (November 20, 2019).
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see Petit Planet Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template
Below are commonly used wikitext from MediaWiki:Edittools. Click on any to insert them in the edit box.
File Pages==Summary====Licensing=={{Fairuse}}{{File|}}
Dynamic Page List¦²«»²{¦}²«»«/»«!----»
Array in DPL¹^2{}^2^2{¹}^2
Parser Functions{{#if:||}}
{{#ifeq:|||}}
{{#expr:}}
{{#switch:||#default=}}
{{#replace:||}}
{{#titleparts:}}
{{#tag:|}}
Markup{{}}|[][[]][[Category:]]#REDIRECT [[]] [[Category:Redirect Pages]]<code></code><includeonly></includeonly><noinclude></noinclude><nowiki></nowiki><!----><br>§
Notices{{Stub|}}{{Stub Dialogue}}{{Upcoming}}{{Under Construction}}{{Placeholder|}}
Magic Words{{!}}{{formatnum:}}{{lc:}}{{uc:}}{{PAGENAME}}{{FULLPAGENAME}}{{ROOTPAGENAME}}{{BASEPAGENAME}}{{SUBPAGENAME}}{{DISPLAYTITLE:|noreplace}}__TOC____NOTOC____EXPECTUNUSEDCATEGORY____HIDDENCAT__
HTML Entities&mdash;&nbsp;&comma;&shy;