Difference between revisions of "Template:Duration"

From blackwiki
Jump to navigation Jump to search
imported>AGK
m (Protected Template:Duration: Highly-visible template (thousands of transclusions) (‎[edit=autoconfirmed] (indefinite) ‎[move=sysop] (indefinite)))
imported>Lachlan Foley
Line 1: Line 1:
 +
{{Template for discussion/dated|page=Duration|link=Wikipedia:Templates for discussion/Log/2013 March 7#Template:Duration|type=inline|help=off}}
 
{{#if:{{{4|}}} | {{Error|Error: Parameter number 4 should not be specified.}}
 
{{#if:{{{4|}}} | {{Error|Error: Parameter number 4 should not be specified.}}
 
  | {{#ifexpr:{{{h|{{{1|}}}}}}{{{m|{{{2|0}}}}}}{{{s|{{{3|0}}}}}}
 
  | {{#ifexpr:{{{h|{{{1|}}}}}}{{{m|{{{2|0}}}}}}{{{s|{{{3|0}}}}}}

Revision as of 00:06, 7 March 2013

Template:Template for discussion/dated

50px Template documentation[view] [edit] [history] [purge]

Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).

This template emits the hAudio microformat.

Usage

Unformatted input

An unformatted duration can be input in the first parameter: {{Duration|10:20:30}} (hours:minutes:seconds) or {{Duration|20:30}} (minutes:seconds). There must be a seconds value, as inputs in hours and minutes are indistinguishable from inputs in minutes and seconds.

Numbered parameters

{{Duration|10|20|30}}

where parameters are hours, minutes and seconds respectively. If the hours or minutes values are zero, then leave them blank (e.g. {{Duration||20|30}}). Minutes and seconds values default to zero, although they should ideally be specified.

h, m and s parameters

{{Duration|h=10|m=20|s=30}}

where h, m and s are hours, minutes and seconds respectively. Minutes and seconds values default to zero, although they should ideally be specified.

Parent templates

This template can be used in:

In {{Infobox album}}, the microformat is added automatically if there is not one already. However, more complicated values might require this template.

Examples

Unformatted input

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

Expression error: Unrecognized punctuation character ":".

h, m and s parameters

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Expression error: Unrecognized word "one".

Error: 's' must not be greater than 59.

Error: 'h' and 'm' values must be integers.

Numbered parameters

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Error: 'h' and 'm' values must be integers.

Expression error: Missing operand for >.

(blank)

(blank)

Error: Parameter number 4 should not be specified.

Expression error: Unrecognized word "one".

Error: 's' must not be greater than 59.

Error: 'h' and 'm' values must be integers.

Microformat

Template:UF-audio-part

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Duration

For use in templates emitting the hAudio [[microformat]]

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Hoursh 1

no description

Example
3
Numbersuggested
Minutesm 2

no description

Example
32
Numbersuggested
Secondss 3

no description

Example
42
Numbersuggested