Template:Birth date and age: Difference between revisions
Appearance
Create birth date template |
Create or repair template to remove red links and rendering errors across articles |
||
| Line 1: | Line 1: | ||
{{{1}}}/{{{2}}} | <includeonly><span class="bday" style="display:none;">{{{1}}}-{{padleft:{{#expr:{{{2}}}}}|2|0}}-{{padleft:{{#expr:{{{3}}}}}|2|0}}</span>{{#if:{{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} {{{1}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}}, {{{1}}}}} (age {{#expr: {{CURRENTYEAR}} - {{{1}}} - {{#ifexpr: ({{CURRENTMONTH}} < {{{2}}}) or (({{CURRENTMONTH}} = {{{2}}}) and ({{CURRENTDAY}} < {{{3}}})) | 1 | 0 }} }})</includeonly><noinclude> | ||
Displays a date of birth in Manual of Style format followed by the subject's current age. | |||
<pre> | |||
{{Birth date and age| | <pre>{{Birth date and age|1947|6|13}} -> June 13, 1947 (age 78) | ||
{{Birth date and age|1947|6|13|df=y}} -> 13 June 1947 (age 78)</pre> | |||
Parameters are year, month number and day. Replaces an earlier revision that output <code>1947/6/13</code>, which did not follow the [[CEO.wiki:Manual of Style|Manual of Style]]. | |||
[[Category:Date templates]] | [[Category:Date templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 05:25, 25 August 2026
Displays a date of birth in Manual of Style format followed by the subject's current age.
{{Birth date and age|1947|6|13}} -> June 13, 1947 (age 78)
{{Birth date and age|1947|6|13|df=y}} -> 13 June 1947 (age 78)
Parameters are year, month number and day. Replaces an earlier revision that output 1947/6/13, which did not follow the Manual of Style.