Draft: New Countdown Template
The actual draft for the template can be found here: Template:Countdown/sandbox
The test page for the draft template is found here: Template:Countdown/testcases
This page is a draft of the documentation that will eventually be moved over to Template:Countdown.
Contents
Completed
Parameters
'end-date'
- Required?: Yes
The date that the countdown ends. It can be in any date format that the #time parser function supports.
'end-time'
- Required?: Optional
The time that the countdown ends, on the day defined by 'end-date'. It can be in any time format that the #time parser function supports.
If left blank, the template will default to midnight.
'utc-offset'
- Required?: Optional
The time zone of the 'end-time parameter, defined by the number of hours offset from UTC.
If left blank, the template will default to UTC+0.
Sub-templates
Sub-templates are smaller templates used to help make the entire template more manageable, similar to variables. Do note: "Sub-templates," as far as I can tell, is not a standard technical term.
timeDiff
Calculates the difference between the current time and a defined time.
Planned
Elements of the template found in this section are either in progress or simply hypothetical. They are used to guide the process of creating the template.
Parameters
'display-style'
- Required?: Optional
The style of the countdown, which can be either text or a visual clock (created by using a table with invisible borders). If left blank, the template will default to text.
'first-time-unit'
- Required?: Optional
The first time unit to be displayed on the countdown. For example, putting "hours" will create a countdown where the largest unit of time is hours, not days. If 'first-time-unit' is more precise than 'last-time-unit', the template will not return anything.
If left blank, the template defaults to using days.
'last-time-unit'
- Required?: Optional
The last time unit to be displayed on the countdown. For example, putting "hours" will create a countdown where the smallest unit of time is hours, not minutes or seconds. If 'last-time-unit' is less precise than 'first-time-unit', the template will not return anything.
If left blank and 'end-time' is also blank, the template defaults to using days as the last time unit. If left blank, but 'end time' is not blank, the template defaults to using seconds.
'when-zero'
- Required?: Optional
The message to return or action to do when the countdown reaches zero. This can be used either to display a message or pass on an action to another part of a larger template. 'display-style' does not affect this parameter.
The template will not use a default for this parameter when blank.
Usages
- Countdown to episode broadcasts and manga file releases
- Control the newepisode and newmovie templates to display a different message when either type of program has been broadcasted/released.