Main Page

Template:Countdown/doc

From Arks-Visiphone
Jump to navigation Jump to search
Main article: Template:Countdownall

Parameters

Parameter Description
Region (Optional) Region to be stated next to the countdown.
Offset (Optional) Offset is a special parameter (usually timezone, e.g. GMT+8) that must be used if you are an author of templates incorporating countdown and are parsing one input into multiple timezone outputs, in that case, do not forcefeed an offset by hand into the template and use this parameter instead. This is because if there are some users that leave blank inputs, those blanks will be combined with your forcefed offset to form midnight + your offset.
EventName Event name, must be unique, or the countdown end message will display for all countdowns once one TimeEnd is reached.
  • If unsure, {{PAGENAME}} is suggested.
TimeStart Start date and time, accepts all formats except those that contain fullstops.
  • If not included, will jump straight into "Ends in: Time Remaining" by assuming the start time is now.
  • When not reached, the countdown will show "Starts in:"
  • When TimeStart has been reached, the countdown will show "Event has started".
  • When ongoing, the countdown will show "Ends in:"
  • When TimeEnd has been reached, the countdown will show "Event has concluded."
  • Any invalid dates, blanks, or long past TimeEnd dates will not show the countdown and will be a blank space instead.
TimeEnd End date and time, accepts all formats except those that contain fullstops.

Examples

Case: Offset

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

Case: Upcoming

{{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

{{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

{{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

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

Case: Blank Start Ended

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

Case: Blank End

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

Case: Blank End Started

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

Case: Invalid Start

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

Case: Invalid End

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

Case: Invalid Start End

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

Case: Blank

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

General Info

(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 20th, 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 04, 2018 06:00, the syntax automatically assumes UTC.