Actions

Template

Difference between revisions of "Birth date and age/doc"

From DramaWiki

< Template:Birth date and age
m
 
Line 1: Line 1:
{{Documentation subpage}}<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|Birth date and age}}</includeonly>
+
{{documentation subpage}}
The '''{{tl|Birth date and age}}''' template will return a person’s date of birth and optionally his/her age. It has the shortcut '''{{tl|bda}}'''.
 
  
===Syntax===
+
The '''{{tl|birth date and age}}''' template will return a person's date of birth and his/her calculated age. It has the shortcut '''{{tl|bda}}'''.
====To display a birth date with calculated age====
 
:<code><nowiki>{{Birth date and age|year of birth|month of birth|day of birth}}</nowiki></code>
 
  
'''This form is only intended for living persons.''' In the rare case that a living person's birth date is given in a non-Gregorian calendar this template should not be used. The parameter names 'year', 'month', and 'day' can be used instead of the first, second, and third parameters for 'Birth date and age' only.
+
'''This template is intended for living persons only.''' In the rare case that a living person's birth date is given in a non-Gregorian calendar this template should not be used.
  
===={{tl|Bda}} is a redirect to {{tl|Birth date and age}}====
+
==Usage==
:<code><nowiki>{{Bda|year of birth|month of birth|day of birth}}</nowiki></code>
+
To display a birth date with calculated age use:
  
Examples:
+
:<code><nowiki>{{birth date and age|year of birth|month of birth|day of birth}}</nowiki></code>
  
:<code><nowiki>{{Birth date and age|1993|2|24|mf=yes}}</nowiki></code> returns ''{{Birth date and age|1993|2|24}}''
+
or the shortcut:
:<code><nowiki>{{Birth date and age|1993|2|24|mf=yes}}</nowiki></code> returns ''{{Birth date and age|1973|06|4}}''
+
 
 +
:<code><nowiki>{{bda|year of birth|month of birth|day of birth}}</nowiki></code>
 +
 
 +
The parameters for year (1) and day (3) are numerical. The second parameter, for the month, can be numerical or passed as a string. The month name is case insensitive and may be abbreviated. The parameter names 'year', 'month', and 'day' can be used instead of the first, second, and third parameters.
 +
 
 +
;Examples<nowiki>:</nowiki>
 +
using default parameters for year/month/day
 +
:<code><nowiki>{{birth date and age|1983|1|4}}</nowiki></code> returns "{{birth date and age|1983|1|4}}"
 +
:<code><nowiki>{{birth date and age|1983|01|04}}</nowiki></code> returns "{{birth date and age|1983|01|04}}"
 +
:<code><nowiki>{{birth date and age|1983|Jan|04}}</nowiki></code> returns "{{birth date and age|1983|Jan|04}}"
 +
:<code><nowiki>{{birth date and age|1983|January|4}}</nowiki></code> returns "{{birth date and age|1983|January|4}}"
 +
 
 +
using named parameters
 +
:<code><nowiki>{{birth date and age|day=4|month=1|year=1983}}</nowiki></code> returns "{{birth date and age|day=4|month=1|year=1983}}"
 +
:<code><nowiki>{{birth date and age|month=January|day=4|year=1983}}</nowiki></code> returns "{{birth date and age|month=January|day=4|year=1983}}"
 +
 
 +
==See also==
 +
This template was derived from [[Wikipedia:Template:Birth date and age|Wikipedia]], but this is a less complex version which takes no additional parameters.
 +
 
 +
<includeonly>
 +
[[Category:Date Templates]]
 +
</includeonly>

Latest revision as of 16:25, 6 February 2013

This is a documentation subpage for Template:Birth date and age.

The {{birth date and age}} template will return a person's date of birth and his/her calculated age. It has the shortcut {{bda}}.

This template is intended for living persons only. In the rare case that a living person's birth date is given in a non-Gregorian calendar this template should not be used.

Usage

To display a birth date with calculated age use:

{{birth date and age|year of birth|month of birth|day of birth}}

or the shortcut:

{{bda|year of birth|month of birth|day of birth}}

The parameters for year (1) and day (3) are numerical. The second parameter, for the month, can be numerical or passed as a string. The month name is case insensitive and may be abbreviated. The parameter names 'year', 'month', and 'day' can be used instead of the first, second, and third parameters.

Examples:

using default parameters for year/month/day

{{birth date and age|1983|1|4}} returns "1983-Jan-04 (age 43)"
{{birth date and age|1983|01|04}} returns "1983-Jan-04 (age 43)"
{{birth date and age|1983|Jan|04}} returns "1983-Jan-04 (age 43)"
{{birth date and age|1983|January|4}} returns "1983-Jan-04 (age 43)"

using named parameters

{{birth date and age|day=4|month=1|year=1983}} returns "1983-Jan-04 (age 43)"
{{birth date and age|month=January|day=4|year=1983}} returns "1983-Jan-04 (age 43)"

See also

This template was derived from Wikipedia, but this is a less complex version which takes no additional parameters.