Jump to content

Template:Birth date and age/doc: Difference between revisions

updte, ce
(updte, ce)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|Birth date and age
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1}}|Birth date and age
|{{high-risk|265,000+}}
|{{high-risk|224,000+}}
|{{high-risk|104,000+}}
|{{high-use|84,000+}}
}}</includeonly>
}}</includeonly>
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
{{ombox
These templates ('''{{tl|Birth date}}''' and '''{{tl|Birth date and age}}''') return a person’s date of birth and optionally his/her age. These have the shortcuts '''{{tl|dob}}''' and '''{{tl|bda}}''' respectively.
| type      = content
 
| textstyle = color:#CC0000; font-weight: bold;
<big style="color:#CC0000;">Do NOT use this template when the person’s exact date of birth is disputed or unknown.</big>
| text      = DO NOT use this template when the person’s exact date of birth is disputed or unknown.
}}
The '''{{tl|Birth date}}''' and '''{{tl|Birth date and age}}''' templates will return a person’s date of birth and optionally his/her age. They have the shortcuts '''{{tl|dob}}''' and '''{{tl|bda}}''', respectively.


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.
Line 14: Line 15:
===Syntax===
===Syntax===
==== To display the birth date only ====
==== To display the birth date only ====
:<nowiki>{{Birth date|year of birth|month of birth|day of birth|additional parameters}}</nowiki> '''Do not use with non-Gregorian dates''' because the resulting hCard hidden date will be false.
:<nowiki>{{Birth date|year of birth|month of birth|day of birth|additional parameters}}</nowiki>  
 
'''Do not use with non-Gregorian dates''' because the resulting hCard hidden date will be false.


===={{tl|dob}} is a redirect to {{tl|Birth date}}====
===={{tl|dob}} is a redirect to {{tl|Birth date}}====
Line 39: Line 42:
:<code><nowiki>{{Birth date and age|1993|2|24|df=yes}}</nowiki></code> returns {{Birth date and age|1993|2|24|df=yes}}
:<code><nowiki>{{Birth date and age|1993|2|24|df=yes}}</nowiki></code> returns {{Birth date and age|1993|2|24|df=yes}}


===Month First (mf) and Day First (df) options===
====Month First (mf) and Day First (df) options====
The '''df''' (day first) and '''mf''' (month first) parameters indicate the intended date format to display. The appropriate parameter should be set to "y" or "yes" e.g. '''df=yes''' or '''mf=y'''.
The '''df''' (day first) and '''mf''' (month first) parameters indicate the intended date format to display. The appropriate parameter should be set to "y" or "yes" e.g. '''df=yes''' or '''mf=y'''.


Line 59: Line 62:


===hCard microformat===
===hCard microformat===
The templates also returns the date, hidden by CSS, in the [[WP:ISO 8601|ISO 8601]] ''format'' (but not necessarily to the ISO 8601 ''standard'') needed by [[HCard|hCard microformat]]s. for example:
The templates also returns the date, hidden by CSS, in the [[WP:ISO 8601|ISO 8601]] ''format'' (but not necessarily to the ISO 8601 ''standard'') needed by [[hCard|hCard microformat]]s. for example:


:<code><nowiki>(<span class="bday">1993-02-24</span>)</nowiki></code>
:<code><nowiki>(<span class="bday">1993-02-24</span>)</nowiki></code>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.