Template:Death date and age/doc: Difference between revisions
(New page: {{documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE YOU CAN EDIT THE TEMPLATE DOCUMENTATION BELOW THIS COMMENT --> ==Usage== The templat...) |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{documentation subpage}} | {{documentation subpage}} | ||
<includeonly>{{high-use|2,000+}}</includeonly> | |||
<!-- | <!-- | ||
PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE | PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE | ||
| Line 9: | Line 10: | ||
<!--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. | <!--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. | ||
--> | --> | ||
Syntax: | |||
: <nowiki>{{</nowiki>Death date | : <nowiki>{{</nowiki>Death date|''year of death''|''month of death''|''day of death''|''year of birth''|''month of birth''|''day of birth''<nowiki>}}</nowiki> | ||
or | |||
: <nowiki>{{</nowiki>Death date and age|''year of death''|''month of death''|''day of death''|''year of birth''|''month of birth''|''day of birth''<nowiki>}}</nowiki> | |||
<nowiki>{{Death date and age|1993|2|24|1941|4|12}}</nowiki | : <nowiki>{{</nowiki>Dda|''year of death''|''month of death''|''day of death''|''year of birth''|''month of birth''|''day of birth''<nowiki>}}</nowiki> | ||
Examples: | |||
: <nowiki>{{Death date|1993|2|24|1941|4|12}}</nowiki> returns "{{Death date|1993|2|24|1941|4|12|nocategory=1}}" | |||
: <nowiki>{{Death date and age|1993|2|24|1941|4|12}}</nowiki> returns "{{Death date and age|1993|2|24|1941|4|12|nocategory=1}}" | |||
===Day first (df) option=== | ===Day first (df) option=== | ||
An optional parameter, df, 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, and applies only for users who have not set a date formatting preference. | An optional parameter, df, 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, and applies only for users who have not set a date formatting preference. | ||
Example<nowiki>:</nowiki> | |||
<nowiki>{{Death date and age|1993|2|24|1941|4|12|df=yes}}</nowiki | : <nowiki>{{Death date and age|1993|2|24|1941|4|12|df=yes}}</nowiki> returns "24 February [[:Category:1993 deaths|1993]] (aged 51)" to readers without a date preference. | ||
<!--When only the year of a person's birth and/or death are known, or if it is desired not to state a person's full dates of birth and death for privacy reasons, use the templates {{tl|Birth year and age}} and {{tl|Death year and age}} instead. | <!--When only the year of a person's birth and/or death are known, or if it is desired not to state a person's full dates of birth and death for privacy reasons, use the templates {{tl|Birth year and age}} and {{tl|Death year and age}} instead. | ||
--> | --> | ||
===Notes=== | ===Notes=== | ||
'''Note:''' {{tl|Death date}} and {{tl|Death date and age}} automatically add the category "xxxx | '''Note:''' {{tl|Death date}} and {{tl|Death date and age}} automatically add the category "xxxx deaths" to the page they are used on! If you do not want a category to be added, set the optional '''nocategory''' parameter (nocategory=1, for example). | ||
'''Note:''' The template will appear broken when the parameters are left blank. | '''Note:''' The template will appear broken when the parameters are left blank. | ||
Latest revision as of 18:04, 3 July 2008
Usage
The templates {{Death date}} and {{Death date and age}} return a person's date of death and optionally his/her age at that date. The latter also has the shortcut {{Dda}}.
Syntax:
- {{Death date|year of death|month of death|day of death|year of birth|month of birth|day of birth}}
or
- {{Death date and age|year of death|month of death|day of death|year of birth|month of birth|day of birth}}
- {{Dda|year of death|month of death|day of death|year of birth|month of birth|day of birth}}
Examples:
- {{Death date|1993|2|24|1941|4|12}} returns "February 24, 1993"
- {{Death date and age|1993|2|24|1941|4|12}} returns "February 24, 1993 (aged 51)"
Day first (df) option
An optional parameter, df, 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, and applies only for users who have not set a date formatting preference.
Example:
- {{Death date and age|1993|2|24|1941|4|12|df=yes}} returns "24 February 1993 (aged 51)" to readers without a date preference.
Notes
Note: {{Death date}} and {{Death date and age}} automatically add the category "xxxx deaths" to the page they are used on! If you do not want a category to be added, set the optional nocategory parameter (nocategory=1, for example).
Note: The template will appear broken when the parameters are left blank.
See also
- {{Birth date}}
- {{Birth date and age}} – same as {{Birth date}}, except that "(age ##)" appears after the birth date
- {{Death date}}
- {{Death date and age}} – same as {{Death date}}, except that "(aged ##)" appears after the death date