Editing Template:Birth date and age
Template page
More actions
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
<includeonly><!-- Template:Birth date and age --> | <includeonly><!-- Template:Birth date and age --> | ||
{{#switch: {{#if:{{{3|}}}|3|{{#if:{{{2|}}}|2|{{#if:{{{1|}}}|1|0}}}}}} | {{#switch: {{#if:{{{3|}}}|3|{{#if:{{{2|}}}|2|{{#if:{{{1|}}}|1|0}}}}}} | ||
| 3 = {{MONTHNAME|{{{2}}}}} {{{3}}}, {{{1}}} | | 3 = {{MONTHNAME|{{{2}}}}} {{{3}}}, {{{1}}}<span class="noprint"> (age {{#expr:{{#time:Y}} - {{{1}}} - ( ({{#time:n}} < {{{2}}}) or ({{#time:n}} = {{{2}}} and {{#time:j}} < {{{3}}}) ) }})</span> | ||
| 2 = {{MONTHNAME|{{{2}}}}}, {{{1}}} | | 2 = {{MONTHNAME|{{{2}}}}}, {{{1}}} | ||
| 1 = {{{1}}} | | 1 = {{{1}}} | ||
| Line 8: | Line 8: | ||
{{clear}} | {{clear}} | ||
== Usage == | == Usage == | ||
This template formats a birth date and | This template formats a birth date and calculates the person's current age. | ||
<pre> | <pre> | ||
{{Birth date and age|YYYY|MM|DD}} | {{Birth date and age|YYYY|MM|DD}} | ||
</pre> | </pre> | ||
* '''Example:''' | * '''Example:''' <code><nowiki>{{Birth date and age|1955|10|28}}</nowiki></code> will display "October 28, 1955 (age 69)". | ||
[[Category:Date templates]] | [[Category:Date templates]] | ||
</noinclude> | </noinclude> | ||