Template:Birth date
To use this template on a player's form, basically do the following:
Examples
- Unnamed parameters for year, month, day
{{Birth date and age|1993|2|24}}returns "February 24, 1993"{{Birth date and age|1993|2|24|df=yes}}returns "24 February 1993"{{Birth date and age|1993|2|24|mf=yes}}returns "February 24, 1993"
- Named parameters for year, month, day
{{Birth date and age|year=1993|month=2|day=24}}returns "February 24, 1993"{{Birth date and age|year=1993|month=2|day=24|df=yes}}returns "24 February 1993"{{Birth date and age|year=1993|month=2|day=24|mf=yes}}returns "February 24, 1993"
Using month name instead of number
The following examples use a parameter value that will not work in the {{Birth date}}, {{Death date}}, or {{Death date and age}} templates.
- Unnamed parameters for year, month name, day
{{Birth date and age|1993|Feb|24}}returns "February 24, 1993"{{Birth date and age|1993|Feb|24|df=yes}}returns "24 February 1993"{{Birth date and age|1993|Feb|24|mf=yes}}returns "February 24, 1993"
- Named parameters for year, month name, day
{{Birth date and age|year=1993|month=Feb|day=24}}returns "February 24, 1993"{{Birth date and age|year=1993|month=Feb|day=24|df=yes}}returns "24 February 1993"{{Birth date and age|year=1993|month=Feb|day=24|mf=yes}}returns "February 24, 1993"
Using full date in one parameter
The following examples use a parameter value that will not work in the {{Birth date}}, {{Death date}}, or {{Death date and age}} templates.
The date format entered does not change the date format displayed, which is MDY by default or DMY if |df=y (to display the date in the same format it was entered, use {{Birth-date and age}}).
- Unnamed parameter for full date (output in MDY format)
{{Birth date and age|1993-2-24}}returns "Expression error: Unrecognized punctuation character "{"., 1993-2-24"{{Birth date and age|Feb 24, 1993}}returns "Expression error: Unrecognized punctuation character "{"., Feb 24, 1993"{{Birth date and age|24 Feb 1993}}returns "Expression error: Unrecognized punctuation character "{"., 24 Feb 1993"
- Unnamed parameter for full date (output in DMY format)
{{Birth date and age|1993-2-24|df=y}}returns "Expression error: Unrecognized punctuation character "{". 1993-2-24"{{Birth date and age|24 Feb 1993|df=y}}returns "Expression error: Unrecognized punctuation character "{". 24 Feb 1993"{{Birth date and age|Feb 24, 1993|df=y}}returns "Expression error: Unrecognized punctuation character "{". Feb 24, 1993"
- Output as compared to {{Birth-date and age}}
{{Birth date and age|24 February 1993}}returns "Expression error: Unrecognized punctuation character "{"., 24 February 1993"{{Birth-date and age|24 February 1993}}returns "Template:Birth-date and age"{{Birth date and age|Feb. 24, 1993}}returns "Expression error: Unrecognized punctuation character "{"., Feb. 24, 1993"{{Birth-date and age|Feb. 24, 1993}}returns "Template:Birth-date and age"
TemplateData
Birth date
<templatedata> { "description": "This template will return a living person's date of birth and age. Using this template rather than simply inserting the date into articles allows for the inclusion of hidden metadata about the date. This metadata can be used by web browsers and other software tools to extract the details, and display them using some other website or mapping tool, index, or search them.", "params": { "1": { "label": "Year of birth", "description": "The year in which the person was born", "type": "number", "example": "1993", "required": true, "aliases": [ "year" ] }, "2": { "label": "Month of birth", "description": "The month (number) in which the person was born", "type": "number", "example": "2", "required": true, "aliases": [ "month" ] }, "3": { "label": "Day of birth", "description": "The day (number) in which the person was born", "type": "number", "example": "24", "required": true, "aliases": [ "day" ] }, "df": { "label": "Day first", "description": "When set to 'y' or 'yes', the date of birth is output in a DMY format", "type": "string", "example": "y", "required": false }, "mf": { "label": "Month first", "description": "When set to 'y' or 'yes', stresses that the default MDY date format is intended for the date of birth", "type": "string", "example": "y", "required": false } } } </templatedata>
| The above documentation is transcluded from Template:Birth date and age/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |