Difference between revisions of "Draft: New Countdown Template"
m (Removed Variables section) |
(→Parameters: Converted underscores to hyphen in parameter names since that looks like the standard for wikis) |
||
Line 7: | Line 7: | ||
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. | 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 === | === Parameters === | ||
− | ==== ' | + | ==== 'end-date' ==== |
*'''Required?:''' Yes<br> | *'''Required?:''' Yes<br> | ||
The date that the countdown ends. It can be in any date format that the #time parser function supports. | The date that the countdown ends. It can be in any date format that the #time parser function supports. | ||
− | ==== ' | + | ==== 'end-time' ==== |
*'''Required?:''' Optional<br> | *'''Required?:''' Optional<br> | ||
− | 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.<br> | + | 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.<br> |
If left blank, the template will default to midnight. | If left blank, the template will default to midnight. | ||
− | ==== ' | + | ==== 'utc-offset' ==== |
*'''Required?:''' Optional<br> | *'''Required?:''' Optional<br> | ||
− | The time zone of the '''' | + | The time zone of the ''''end-time''' parameter, defined by the number of hours offset from UTC.<br> |
If left blank, the template will default to UTC+0. | If left blank, the template will default to UTC+0. | ||
− | ==== ' | + | ==== 'display-style' ==== |
*'''Required?:''' Optional<br> | *'''Required?:''' Optional<br> | ||
The style of the countdown, which can be either text or a visual clock (created by using a table with invisible borders). | 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. | If left blank, the template will default to text. | ||
− | ==== ' | + | ==== 'first-time-unit' ==== |
*'''Required?:''' Optional<br> | *'''Required?:''' Optional<br> | ||
− | 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 '''' | + | 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.<br> |
If left blank, the template defaults to using days. | If left blank, the template defaults to using days. | ||
− | ==== ' | + | ==== 'last-time-unit' ==== |
*'''Required?:''' Optional<br> | *'''Required?:''' Optional<br> | ||
− | 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 '''' | + | 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.<br> |
− | If left blank and '''' | + | 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<br> | *'''Required?:''' Optional<br> | ||
− | 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. '''' | + | 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.<br> |
The template will not use a default for this parameter when blank. | The template will not use a default for this parameter when blank. | ||
Revision as of 22:52, 31 December 2024
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
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
'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.
'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.