Jump to content

Template:Countdown/doc

From The Petit Planet Wiki
Revision as of 00:04, 1 December 2025 by Eleiyas (talk | contribs) (Created page with "{{Documentation/Header}} {{See also|Template:Countdownall}} == Parameters == <templatedata> { "params": { "Region": { "description": "The region the countdown is for", "example": "NA", "suggested": true }, "TimeStartOffset": { "label": "Start Offset", "description": "The offset for the start time", "example": "UTC+8", "suggested": true }, "TimeEndOffset": { "label": "End Offset", "description": "The offset for the end time", "exam...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is the documentation page for Countdown.
It contains usage information, categories, and other content not part of the original template page.

Parameters[edit source]

Template for displaying a countdown

Template parameters

ParameterDescriptionTypeStatus
RegionRegion

The region the countdown is for

Example
NA
Unknownsuggested
Start OffsetTimeStartOffset

The offset for the start time

Example
UTC+8
Unknownsuggested
End OffsetTimeEndOffset

The offset for the end time

Example
UTC+8
Unknownsuggested
Start TimeTimeStart

The time the event starts, formatted as a date

Example
1970-01-01 00:00:00
Unknownsuggested
End TimeTimeEnd

The time the event ends, formatted as a date

Example
1970-01-02 00:00:00
Unknownrequired
Hide TextHideText

Whether to hide the "ends in" text

Unknownsuggested
End TextEndText

The text to display when the event ends

Unknownsuggested
Countdown PrefixCountdownPrefix

The prefix to use for the end countdown instead of "Ends in:"

Unknownsuggested

Examples[edit source]

Case: Offset[edit source]

{{Countdown
|Region=AS
|EventName=Offset1
|TimeStart=2024/01/15 23:00:00
|TimeStartOffset=GMT+8
|TimeEnd=2025/01/31 03:59:59
|TimeEndOffset=GMT+8
}}

Case: Upcoming[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample1
|TimeStart=2025/01/15 23:00:00 GMT+8
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}

Case: Started[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample2
|TimeStart=2021-01-8 10:00:00 GMT+8
|TimeEnd=2025-01-31 03:59:59 GMT+8
}}

Case: Long Ended[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample3
|TimeStart=2020-01-16 10:00:00 GMT+8
|TimeEnd=2020-01-31 03:59:59 GMT+8
}}

Case: Blank Start[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample4
|TimeStart=
|TimeEnd=2025-01-31 03:59:59 GMT+8
}}

Case: Blank Start Ended[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample4
|TimeStart=
|TimeEnd=2020-01-31 03:59:59 GMT+8
}}

Case: Blank End[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample5
|TimeStart=2025-01-31 03:59:59 GMT+8
|TimeEnd=
}}

Case: Blank End Started[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample5
|TimeStart=2020-01-31 03:59:59 GMT+8
|TimeEnd=
}}

Case: Invalid Start[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample6
|TimeStart=aaaaaaaaaaaa
|TimeEnd=2025/01/31 03:59:59 GMT+8
}}

Case: Invalid End[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample7
|TimeStart=2025/01/16 10:00:00 GMT+8
|TimeEnd=aaaaaaaaaaaa
}}

Case: Invalid Start End[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample8
|TimeStart=aaaaaaaaaaaa
|TimeEnd=aaaaaaaaaaaa
}}

Case: Blank[edit source]

{{Countdown
|Region=AS
|EventName=TemplateExample9
|TimeStart=
|TimeEnd=
}}

General Info[edit source]

(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 developer's wiki into this wiki's MediaWiki:ImportJS. It does NOT use the countdown extension.
  • Utilizes the parser functions {{#time:F d, Y h:i:s A e|}} and {{#time:F d, Y|}} 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 not accepted and will throw errors: any dots as they cause non integer values, including dot spacing (2019.1.1) and specifying timezones in non integer (+9.5).
  • If no timezone is specified e.g. October 4, 2018 06:00, the syntax automatically assumes UTC.