Difference between revisions of "Template:Duration"

From blackwiki
Jump to navigation Jump to search
imported>Plastikspork
(Try using tiny)
imported>Plastikspork
(Add a space after the tfd tag)
Line 1: Line 1:
{{Template for discussion/dated|page=Duration|link=Wikipedia:Templates for discussion/Log/2013 March 7#Template:Duration|type=tiny|help=off}}{{#if:{{{4|}}} | {{Error|Error: Parameter number 4 should not be specified.}}
+
{{Template for discussion/dated|page=Duration|link=Wikipedia:Templates for discussion/Log/2013 March 7#Template:Duration|type=tiny|help=off}} {{#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}}}}}}
 
   | {{#ifexpr:60 > {{{s|{{{3|0}}}}}}
 
   | {{#ifexpr:60 > {{{s|{{{3|0}}}}}}

Revision as of 14:52, 8 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

h, m and s parameters

Numbered parameters

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