|
|
(2 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| __NOTOC__
| | <includeonly>{{#if: {{{8|<noinclude>-</noinclude>}}} | |
| {{documentation subpage}} | | {{#if: {{{1|<noinclude>-</noinclude>}}} | |
| <!-- | | {{#if: {{{3|<noinclude>-</noinclude>}}} | |
| PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
| | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| YOU CAN EDIT THE TEMPLATE DOCUMENTATION BELOW THIS COMMENT
| | {{Birth date|{{{2}}}|{{{3}}}|{{{4}}}|df=yes}} |
| -->
| | | |
| {{template shortcut|bdage}} | | {{Birth date and age|{{{2}}}|{{{3}}}|{{{4}}}|df=yes}} |
| | | }} |
| ==Usage==
| | | |
| Depending on the parameters specified, this template displays a person's birth or death year, or full birth or death date, with or without the person's age. It therefore combines the functionality of the following templates:
| | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| *{{tl|Birth date text}}
| | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| *{{tl|Birth date}}
| | {{birth-date|{{{2}}}}} |
| *{{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
| | {{Birth year and age|{{{2}}}}} |
| *{{tl|Death date text}}
| | }} |
| *{{tl|Death date}}
| | }} |
| *{{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
| | }} |
| | | {{#if: {{{1|<noinclude>-</noinclude>}}} | |
| 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.
| | |
| | | | |
| The minimum information required by the template is a birth or death year.
| | {{#if: {{{6|<noinclude>-</noinclude>}}} | |
| | | {{#if: {{{4|<noinclude>-</noinclude>}}} | |
| ==Syntax==
| | {{death date and age|{{{5}}}|{{{6}}}|{{{7}}}|{{{2}}}|{{{3}}}|{{{4}}}|df=yes}} |
| <syntaxhighlight lang="wikitext">
| | | |
| {{BirthDeathAge | [insert "B" for a birth date, or leave blank for a death date] | | | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| [year of birth] | [month of birth] | [day of birth] | [year of death] |
| | {{{7}}} {{MONTHNAME|{{{6}}}}} {{Death year and age|{{{5}}}|{{{2}}}}} |
| [month of death] | [day of death]}}
| | | |
| </syntaxhighlight> | | {{Death date|{{{5}}}|{{{6}}}|{{{7}}}|df=yes}} |
| | | }} |
| Any missing information can simply be left out of the template: see the examples below.
| | }} |
| | | | |
| ==Examples==
| | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| For readability, spaces have been inserted between pipe symbols ("|") where information has not been inserted into the template. When using the template, these spaces can be omitted. Using {{tl|^}} can help space the template
| | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| | | {{Death year and age|{{{5}}}|{{{2}}}}} |
| ===Spacing===
| | | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|{{^}}|1976|{{^}}|{{^}}|2007|1|2}}</syntaxhighlight>
| | {{death-date|{{{5}}}}} |
| {{BirthDeathAge|{{^}}|1976|{{^}}|{{^}}|2007|1|2}}
| | }} |
| | | }} |
| ===Date format===
| | }} |
| An optional parameter, date format, can be set to "yes" to display the day before the month. This is primarily used in articles about people from parts of the world where the day precedes the month in a date.
| | }} |
| | | | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976|1|2|{{^}}|{{^}}|{{^}}}}</syntaxhighlight>
| | {{#if: {{{1|<noinclude>-</noinclude>}}} | |
| {{BirthDeathAge|B|1976|1|2|{{^}}|{{^}}|{{^}}}} | | {{#if: {{{3|<noinclude>-</noinclude>}}} | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976|1|2|{{^}}|{{^}}|{{^}}|yes}}</syntaxhighlight>
| | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| {{BirthDeathAge|B|1976|1|2|{{^}}|{{^}}|{{^}}|yes}} | | {{Birth date|{{{2}}}|{{{3}}}|{{{4}}}}} |
| | | | |
| ===Date of birth===
| | {{Birth date and age|{{{2}}}|{{{3}}}|{{{4}}}}} |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976}}</syntaxhighlight>
| | }} |
| {{BirthDeathAge|B|1976}}
| | | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976|6|7|1990|8|9}}</syntaxhighlight>
| | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| {{BirthDeathAge|B|1976|6|7|1990|8|9}} | | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976|6|7}}</syntaxhighlight>
| | {{birth-date|{{{2}}}}} |
| {{BirthDeathAge|B|1976|6|7}} | | | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge|B|1976|||1990}}</syntaxhighlight>
| | {{Birth year and age|{{{2}}}}} |
| {{BirthDeathAge|B|1976|||1990}} | | }} |
| | | }} |
| ===Date of death===
| | }} |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge| |1976| | |1990| |}}</syntaxhighlight>
| | }} |
| {{BirthDeathAge| |1976| | |1990| |}} | | {{#if: {{{1|<noinclude>-</noinclude>}}} | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge| | | | |1990| |}}</syntaxhighlight>
| | |
| {{BirthDeathAge| | | | |1990| |}}
| | | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge| | | | |1990|8|9}}</syntaxhighlight>
| | {{#if: {{{6|<noinclude>-</noinclude>}}} | |
| {{BirthDeathAge| | | | |1990|8|9}} | | {{#if: {{{4|<noinclude>-</noinclude>}}} | |
| <syntaxhighlight lang="wikitext">{{BirthDeathAge| |1976| | |1990|8|9}}</syntaxhighlight>
| | {{death date and age|{{{5}}}|{{{6}}}|{{{7}}}|{{{2}}}|{{{3}}}|{{{4}}}}} |
| {{BirthDeathAge| |1976| | |1990|8|9}} | | | |
| | | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| ==See also==
| | {{MONTHNAME|{{{6}}}}} {{{7}}}, {{Death year and age|{{{5}}}|{{{2}}}}} |
| * [[Wikipedia:Age calculation templates]]
| | | |
| {{Birth, death and age templates}}
| | {{Death date|{{{5}}}|{{{6}}}|{{{7}}}}} |
| <includeonly>{{Sandbox other||
| | }} |
| <!--PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE. THANKS.--> | | }} |
| | | | |
| [[Category:Date mathematics templates|{{PAGENAME}}]]
| | {{#if: {{{5|<noinclude>-</noinclude>}}} | |
| [[ur:سانچہ:BirthDeathAge]]
| | {{#if: {{{2|<noinclude>-</noinclude>}}} | |
| }}</includeonly>
| | {{Death year and age|{{{5}}}|{{{2}}}}} |
| <templatedata> | | | |
| { | | {{death-date|{{{5}}}}} |
| "params": {
| | }} |
| "1": {
| | }} |
| "description": "Insert 'B' for a birth date, leave blank for a death date.",
| | }} |
| "type": "string",
| | }} |
| "suggestedvalues": [
| | }}</includeonly><noinclude>{{documentation}}</noinclude> |
| "B",
| |
| " "
| |
| ],
| |
| "autovalue": " ",
| |
| "suggested": true
| |
| },
| |
| "2": {
| |
| "label": "Year of birth",
| |
| "example": "1942",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "3": {
| |
| "label": "Month of birth",
| |
| "description": "as a number",
| |
| "example": "1",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "4": {
| |
| "label": "Day of birth",
| |
| "example": "31",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "5": {
| |
| "label": "Year of death",
| |
| "example": "2006",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "6": {
| |
| "label": "Month of death",
| |
| "description": "as a number",
| |
| "example": " 12",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "7": {
| |
| "label": "Day of death",
| |
| "example": "21",
| |
| "type": "number",
| |
| "default": " ",
| |
| "suggested": true
| |
| },
| |
| "8": {
| |
| "label": "Date format",
| |
| "description": "Set this to \"yes\" to display the day before the month.",
| |
| "type": "string",
| |
| "suggestedvalues": [
| |
| "yes",
| |
| " "
| |
| ],
| |
| "default": " ",
| |
| "suggested": true
| |
| }
| |
| },
| |
| "description": "This template displays a person's birth and/or death year, or full birth and/or death date, with or without the person's age. It therefore combines the functionality of the following templates:\n\n*{{tl|Birth date text}}\n*{{tl|Birth date}}\n*{{tl|Birth date and age}} – same as {{tl|Birth date}}, except that \"(age ##)\" appears after the birth date\n*{{tl|Birth year and age}} – year of birth and approximate age\n*{{tl|Death date text}}\n*{{tl|Death date}}\n*{{tl|Death date and age}} – same as {{tl|Death date}}, except that \"(aged ##)\" appears after the death date\n*{{tl|Death year and age}} – year of death and approximate age at death\n\nThe minimum information required by the template is a birth or death year. ",
| |
| "paramOrder": [
| |
| "1",
| |
| "2",
| |
| "3",
| |
| "4",
| |
| "5",
| |
| "6",
| |
| "7",
| |
| "8"
| |
| ],
| |
| "format": "inline"
| |
| } | |
| </templatedata> | |