Difference between revisions of "Draft: New Countdown Template"
m |
m (→timeDiff: Added link in section heading) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The actual draft for the template can be found here: [[Template:Countdown/sandbox]]<br> | The actual draft for the template can be found here: [[Template:Countdown/sandbox]]<br> | ||
+ | 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]]. | This page is a draft of the documentation that will eventually be moved over to [[Template:Countdown]]. | ||
− | == | + | == Completed == |
− | |||
=== 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. | ||
− | ==== ' | + | === 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. | ||
+ | ==== [[Template:timeDiff|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<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. | ||
− | |||
− | |||
− | |||
== Usages == | == Usages == | ||
* Countdown to episode broadcasts and manga file releases | * 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. | * Control the '''newepisode''' and '''newmovie''' templates to display a different message when either type of program has been broadcasted/released. | ||
+ | |||
+ | == Contributors == | ||
+ | <!-- Add your signature in this bullet list to join the project! No need to be dedicate yourself 100%, this is just so we can track who is officially making edits | ||
+ | |||
+ | To add your signature, use "~~~" (no quotes). | ||
+ | --> | ||
+ | * [[User:AvidConanContributor|Avico]] ([[User talk:AvidConanContributor|talk]]) |
Latest revision as of 22:41, 1 January 2025
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.