Difference between revisions of "Template:Birth date and age2/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(create documentation)
 
imported>DePiep
 
(15 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- Categories and interwikis go at the bottom of this page. -->
+
<!-- Categories go at the bottom of this page. -->
 +
 
 +
This template displays a person's birth date and age at a specified date.<br/>
 +
This allows you to show how old a person was at the time they participated in an event or made an achievement.
  
 
== Usage ==
 
== Usage ==
This template displays a person's birth date and age at a specified date.<br>
+
; Syntax
This allows you to show how old a person was at the time they participated in an event or made an achievement.
+
: {{tlc|{{lc:{{BASEPAGENAME}}}}&nbsp;|''specified year''|''specified month''|''specified day''&nbsp;|''year of birth''|''month of birth''|''day of birth''}}
  
; Syntax<nowiki>:</nowiki>
+
; Format
: <tt><nowiki>{{</nowiki>{{PAGENAME}}<nowiki>|</nowiki></tt>''specified year''<tt><nowiki>|</nowiki></tt>''specified month''<tt><nowiki>|</nowiki></tt>''specified day''<tt><nowiki>|</nowiki></tt>''year of birth''<tt><nowiki>|</nowiki></tt>''month of birth''<tt><nowiki>|</nowiki></tt>''day of birth''<tt><nowiki>}}</nowiki></tt>
+
: {{tlf|{{lc:{{BASEPAGENAME}}}}&nbsp;|''yyyy''|''mm''|''dd''&nbsp;|''yyyy''|''mm''|''dd''&nbsp;|df{{=}}y}}
  
; Format:
+
; Example
:<tt><nowiki>{{</nowiki>{{PAGENAME}}|yyyy|mm|dd|yyyy|mm|dd|df=y<nowiki>}}</nowiki></tt>
+
{{tlf|{{lc:{{BASEPAGENAME}}}} <nowiki>|1988|6|10 |1961|7|4 |df=y</nowiki>}} produces:&nbsp; {{birth date and age2 |1988|6|10 |1961|7|4 |df=y}}
  
; Example<nowiki>:</nowiki>
+
== TemplateData ==
<nowiki>{{Birth date and age2|1988|6|10|1961|7|4|df=y}}</nowiki> displays as "{{Birth date and age2|1988|6|10|1961|7|4|df=y}}".
+
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
"params": {
 +
"1": {
 +
"description": "Adds the specified year.",
 +
"example": "1970",
 +
"type": "number",
 +
"suggested": true,
 +
"label": "Specified year"
 +
},
 +
"2": {
 +
"description": "Adds the specified month.",
 +
"example": "5",
 +
"type": "number",
 +
"suggested": true,
 +
"label": "Specified month"
 +
},
 +
"3": {
 +
"description": "Adds the specified day.",
 +
"example": "23",
 +
"type": "number",
 +
"suggested": true,
 +
"label": "Specified day"
 +
},
 +
"4": {
 +
"example": "1952",
 +
"type": "number",
 +
"suggested": true,
 +
"label": "Birth year"
 +
},
 +
"5": {
 +
"example": "4",
 +
"suggested": true,
 +
"label": "Birth month",
 +
"type": "number"
 +
},
 +
"6": {
 +
"example": "18",
 +
"type": "number",
 +
"suggested": true,
 +
"label": "Birth day"
 +
},
 +
"df": {
 +
"label": "date first format",
 +
"description": "sets format to dmy",
 +
"example": "y, yes",
 +
"type": "string"
 +
},
 +
"mf": {
 +
"label": "month first format",
 +
"description": "mf=yes sets format to mdy",
 +
"default": "this is the templates default"
 +
}
 +
},
 +
"description": "This template displays a person's birth date and age at a specified date.",
 +
"format": "inline",
 +
"paramOrder": [
 +
"1",
 +
"2",
 +
"3",
 +
"4",
 +
"5",
 +
"6",
 +
"df",
 +
"mf"
 +
]
 +
}
 +
</templatedata>
  
 
== See also ==
 
== See also ==
* [[Wikipedia:Age calculation templates]]
+
{{Birth, death and age templates}}
; Birth, death, age
 
* {{tl|BirthDeathAge}} – carries out the functions of this template and all the following ones
 
* {{tl|Birth date}} – displays the date and related hidden metadata
 
* {{tl|Birth date and age}} – same as {{tl|Birth date}}, except that "(age ##)" appears after the birth date
 
* {{tl|Birth year and age}} – year of birth and approximate age
 
* {{tl|Birth-date and age}} – display birth date and age, accepts dates as text (15 June 1950; June 15, 1950; June 1950; etc.)
 
* {{tl|Birth based on age as of date}} – displays approximate birth year and current age; used when a dated reference mentions the age of a person as of the date of publication
 
* {{tl|Death date}} – displays the date and related hidden metadata
 
* {{tl|Death date and age}} – same as {{tl|Death date}}, except that "(aged ##)" appears after the death date
 
* {{tl|Death year and age}} – year of death and approximate age at death
 
* {{tl|Death-date and age}} – display death date and age, accepts date as text (15 June 1950; June 15, 1950; June 1950; etc.)
 
; Age only
 
* {{tl|Age}} – age based on the number of full years between two dates (or a specified date and current date)
 
* {{tl|Age nts}} – similar to the above, but will sort correctly in sortable tables
 
* {{tl|Age in years and days}} – full years and days between two dates (or a specified date and current date)
 
* {{tl|Age in days}} – age in days between two dates (or a specified date and current date)
 
* {{tl|Age as of date}} – current age in years, based on a known age as of a specified date
 
<includeonly>
 
<!-- Categories and interwikis go here: -->
 
[[Category:Date mathematics templates|Birth date and age2]]
 
 
 
[[fa:الگو:Birth date and age2]]
 
[[ja:Template:生年月日と年齢2]]
 
  
</includeonly>
+
<includeonly>{{basepage subpage
 +
| <!-- Categories below this line, please: -->
 +
[[Category:Date mathematics templates]]
 +
}}</includeonly>

Latest revision as of 17:01, 23 March 2018

This template displays a person's birth date and age at a specified date.
This allows you to show how old a person was at the time they participated in an event or made an achievement.

Usage

Syntax
{{birth date and age2 |specified year|specified month|specified day |year of birth|month of birth|day of birth}}
Format
{{birth date and age2 |yyyy|mm|dd |yyyy|mm|dd |df=y}}
Example

{{birth date and age2 |1988|6|10 |1961|7|4 |df=y}} produces:  (1961-07-04)4 July 1961 (aged 26)

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 Birth date and age2

This template displays a person's birth date and age at a specified date.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Specified year1

Adds the specified year.

Example
1970
Numbersuggested
Specified month2

Adds the specified month.

Example
5
Numbersuggested
Specified day3

Adds the specified day.

Example
23
Numbersuggested
Birth year4

no description

Example
1952
Numbersuggested
Birth month5

no description

Example
4
Numbersuggested
Birth day6

no description

Example
18
Numbersuggested
date first formatdf

sets format to dmy

Example
y, yes
Stringoptional
month first formatmf

mf=yes sets format to mdy

Default
this is the templates default
Unknownoptional

See also