Difference between revisions of "Template:Death date and age/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(Changed {{high-use}} to {{high-risk}} based on number of transclusions and documentation at Template:High-risk)
imported>Sardanaphalus
(Template shortcut, Warning, some formatting (including <tt> replacement), commented out subsection (Using the dda shortcut), sandbox non-categorization)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<includeonly>{{high-risk|145,000+}}</includeonly>
+
<includeonly>{{High-risk|145,000+}}</includeonly>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
+
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
 +
{{Template shortcut |dda}}
 +
{{Warning |''Do '''NOT''' use this template when the person's exact date of birth or death is disputed or unknown; consider {{tl|death year and age}} instead.''}}
  
 
Returns a person's date of death and age at that date.
 
Returns a person's date of death and age at that date.
Available shortcut: '''{{tl|Dda}}'''.
 
  
<big style="color:#CC0000;">Do NOT use this template when the person's exact date of birth or death is disputed or unknown.  Consider {{Tl|Death year and age}} instead.</big>
+
The idea of using the template, as with {{tl|birth date and age}} etc, is to allow for the inclusion of hidden [[metadata]] to be used, indexed or searched by software tools. However, as of October 2008 this template does not include any such metadata and never has since it was founded in December 2006. The apparent reason is that the [[hCard]] [[microformat]], logically enough for an extension of "standard for electronic business cards", contains only "BDAY" field but nothing to do with a death. It is unclear when metadata standard for the dead will be developed and adopted. Until then, the template does nothing but format the input parameters.
  
The idea of using the template, like with {{tl|Birth date and age}} etc, is to allow for the inclusion of hidden [[metadata]] to be used, indexed or searched by software tools. However, as of October 2008 this template does not include any such metadata and never has since it was founded in December 2006. The apparent reason is that the [[hCard]] [[microformat]], logically enough for an extension of "standard for electronic business cards", contains only "BDAY" field but nothing to do with a death. It is unclear when metadata standard for the dead will be developed and adopted. Until then, the template does nothing but format the input parameters.
+
===Syntax===
 +
====To display the death date with age====
 +
: {{tc|death date and age&nbsp;|''year of death''|''month of death''|''day of death''&nbsp;|''year of birth''|''month of birth''|''day of birth''&nbsp;|''additional parameters''}}
  
=== Syntax ===
+
; Formats:
==== To display the death date with age ====
+
: {{plaincode|<nowiki>{{death date and age |yyyy|mm|dd |yyyy|mm|dd |df=yes}}</nowiki>}}
: <code><nowiki>{{Death date and age|</nowiki></code>''year of death''<tt>|</tt>''month of death''<tt>|</tt>''day of death''<tt>|</tt>''year of birth''<tt>|</tt>''month of birth''<tt>|</tt>''day of birth''<tt>|''additional parameters''}}</tt>
+
: {{plaincode|<nowiki>{{death date and age |yyyy|mm|dd |yyyy|mm|dd |mf=yes}}</nowiki>}}
 +
<!--[Superfluous?:]
 +
====Using the {{braces|dda}} shortcut====
 +
: {{plaincode|<nowiki>{{dda |yyyy|mm|dd |yyyy|mm|dd |df=yes}}</nowiki>}}
 +
: {{plaincode|<nowiki>{{dda |yyyy|mm|dd |yyyy|mm|dd |mf=yes}}</nowiki>}}
 +
-->
  
; Format:
+
====Examples====
: <code><nowiki>{{Death date and age|yyyy|mm|dd|yyyy|mm|dd|df=yes}}</nowiki></code>
+
: {{plaincode|<nowiki>{{death date and age |1993|2|24 |1941|4|12 |df=yes}}</nowiki>}} returns:&nbsp; {{death date and age |1993|2|24 |1941|4|12 |df=yes}}
: <code><nowiki>{{Death date and age|yyyy|mm|dd|yyyy|mm|dd|mf=yes}}</nowiki></code>
+
: {{plaincode|<nowiki>{{death date and age |1993|2|24 |1941|4|12 |mf=yes}}</nowiki>}} returns:&nbsp; {{death date and age |1993|2|24 |1941|4|12 |mf=yes}}
  
==== Using the Dda shortcut ====
+
''Note: The template will appear broken when the parameters are left blank.''
: <code><nowiki>{{Dda|yyyy|mm|dd|yyyy|mm|dd|df=yes}}</nowiki></code>
 
: <code><nowiki>{{Dda|yyyy|mm|dd|yyyy|mm|dd|mf=yes}}</nowiki></code>
 
  
==== Examples ====
+
==="day first" (df) and "month first" options===
: <code><nowiki>{{Death date and age|1993|2|24|1941|4|12|df=yes}}</nowiki></code> <br> returns {{Death date and age|1993|2|24|1941|4|12|df=yes}}
 
: <code><nowiki>{{Death date and age|1993|2|24|1941|4|12|mf=yes}}</nowiki></code> <br> returns {{Death date and age|1993|2|24|1941|4|12|mf=yes}}
 
 
 
'''Note''': The template will appear broken when the parameters are left blank.
 
 
 
=== Day First (df) and Month First options ===
 
 
The '''df''' (day first) parameter indicates the intended date format to display. It is switched on by setting it to "y" or "yes" e.g. '''df=yes''' or '''df=y'''.
 
The '''df''' (day first) parameter indicates the intended date format to display. It is switched on by setting it to "y" or "yes" e.g. '''df=yes''' or '''df=y'''.
  
Line 36: Line 36:
  
 
Examples:
 
Examples:
 +
: {{plaincode|<nowiki>{{death date and age |1993|2|24 |1941|4|12 |df=yes}}</nowiki>}} displays&nbsp; "{{death date and age |1993|2|24 |1941|4|12 |df=yes}}"
 +
: {{plaincode|<nowiki>{{death date and age |1993|2|24 |1941|4|12 |mf=yes}}</nowiki>}} displays&nbsp; "{{death date and age |1993|2|24 |1941|4|12 |mf=yes}}"
  
:<nowiki>{{Death date and age|1993|2|24|1941|4|12|df=yes}}</nowiki><br> displays "{{Death date and age|1993|2|24|1941|4|12|df=yes}}"
+
===Alternate templates when specific date unknown===
:<nowiki>{{Death date and age|1993|2|24|1941|4|12|mf=yes}}</nowiki><br> displays "{{Death date and age|1993|2|24|1941|4|12|mf=yes}}"
+
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 e.g. privacy), use the templates {{tl|birth year and age}} and {{tl|death year and age}} instead.
 
 
=== Specific date unknown - alternate templates ===
 
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.
 
  
=== Interaction side-effects with other templates ===
+
===Interaction with other templates===
'''Note:''' Do not use this template inside of the [[WP:PERSONDATA|Persondata]] template as it can interfere with data extraction.
+
* Do not use this template inside the [[WP:PERSONDATA|Persondata]] template as it can interfere with data extraction.
  
=== FAQ ===
+
===FAQ===
Q: Why don't these templates add categories, such as "Births in [Year]" to articles on which they are used? <br>
+
* Q: Why don't these templates add categories such as "Births in [Year]" to articles where they are used?
A: Because they are sometimes used for dates in lists of people, such as sports team members.
+
: A: Because they are sometimes used for dates in lists of people (e.g. members of sports teams).
  
=== Template data ===
+
===TemplateData===
 
{{TemplateDataHeader}}
 
{{TemplateDataHeader}}
 
<TemplateData>
 
<TemplateData>
Line 108: Line 107:
 
</TemplateData>
 
</TemplateData>
  
=== See also ===
+
===See also===
 
* [[Wikipedia:Age calculation templates]]
 
* [[Wikipedia:Age calculation templates]]
 +
 
{{Birth, death and age templates}}
 
{{Birth, death and age templates}}
<includeonly>
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
[[Category:Date mathematics templates|Death date and age]]
 
[[Category:Templates generating microformat date and age|{{BASEPAGENAME}}]]
 
  
</includeonly>
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
 +
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
 +
[[Category:Date mathematics templates]]
 +
[[Category:Templates generating microformat date and age]]
  
<includeonly>
 
 
[[ca:Plantilla:Data naixement i edat]]
 
[[ca:Plantilla:Data naixement i edat]]
</includeonly>
+
}}</includeonly>

Revision as of 11:51, 7 December 2014

Returns a person's date of death and age at that date.

The idea of using the template, as with {{birth date and age}} etc, is to allow for the inclusion of hidden metadata to be used, indexed or searched by software tools. However, as of October 2008 this template does not include any such metadata and never has since it was founded in December 2006. The apparent reason is that the hCard microformat, logically enough for an extension of "standard for electronic business cards", contains only "BDAY" field but nothing to do with a death. It is unclear when metadata standard for the dead will be developed and adopted. Until then, the template does nothing but format the input parameters.

Syntax

To display the death date with age

{{death date and age |year of death|month of death|day of death |year of birth|month of birth|day of birth |additional parameters}}
Formats
Template:Plaincode
Template:Plaincode

Examples

Template:Plaincode returns:  24 February 1993(1993-02-24) (aged 51)
Template:Plaincode returns:  February 24, 1993(1993-02-24) (aged 51)

Note: The template will appear broken when the parameters are left blank.

"day first" (df) and "month first" options

The df (day first) parameter indicates the intended date format to display. It is switched on by setting it to "y" or "yes" e.g. df=yes or df=y.

The default output of this template is the month before the day (American-based style). This default may not be appropriate in articles about people from parts of the world where the day precedes the month in a date (e.g. Europe). In such cases the parameter df should be set.

It is possible to use similar parameter "mf" to stress the month-first format so that relying on the default does not lead an editor or bot to change the format to an unintended value; however, it is ignored by the template itself. (So, should both parameters be mistakenly used at once, df takes precedence.)

Examples:

Template:Plaincode displays  "24 February 1993(1993-02-24) (aged 51)"
Template:Plaincode displays  "February 24, 1993(1993-02-24) (aged 51)"

Alternate templates when specific date unknown

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 e.g. privacy), use the templates {{birth year and age}} and {{death year and age}} instead.

Interaction with other templates

  • Do not use this template inside the Persondata template as it can interfere with data extraction.

FAQ

  • Q: Why don't these templates add categories such as "Births in [Year]" to articles where they are used?
A: Because they are sometimes used for dates in lists of people (e.g. members of sports teams).

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 Death date and age

This template returns a person's date of death and age at that date.

Template parameters

ParameterDescriptionTypeStatus
Year of death1

The year in which the person died

Numberrequired
Month of death2

The month (number) in which the person died

Numberrequired
Day of death3

The day (number) in which the person died

Numberrequired
Year of birth4

The year in which the person was born

Numberrequired
Month of birth5

The month (number) in which the person was born

Numberrequired
Day of birth6

The day (number) in which the person was born

Numberrequired
Day firstdf

When set to 'y' or 'yes', the date of death is output in a DMY format

Stringoptional
Month firstmf

When set to 'y' or 'yes', stresses that the default MDY date format is intended for the date of death

Stringoptional

See also