FANDOM


(Undo revision 21693 by Black60dragon (talk))
(change to work with Birth date and age template)
Line 1: Line 1:
<includeonly>{{#ifexpr:{{CURRENTMONTH}}-{{{birth_month|1}}}<0
+
<includeonly>{{#ifexpr:{{CURRENTMONTH}}-{{{2|{{{birth_month|1}}}}}}<0
|{{#expr:{{CURRENTYEAR}}-{{{birth_year|1980}}}-1}}
+
|{{#expr:{{CURRENTYEAR}}-{{{1|{{{birth_year|1980}}}}}}-1}}
|{{#ifexpr:{{CURRENTMONTH}}-{{{birth_month|1}}}=0
+
|{{#ifexpr:{{CURRENTMONTH}}-{{{2|{{{birth_month|1}}}}}}=0
|{{#ifexpr:{{CURRENTDAY}}-{{{birth_day|10}}}>=0
+
|{{#ifexpr:{{CURRENTDAY}}-{{{3|{{{birth_day|10}}}}}}>=0
|{{#expr:{{CURRENTYEAR}}-{{{birth_year|1980}}}}}
+
|{{#expr:{{CURRENTYEAR}}-{{{1|{{{birth_year|1980}}}}}}}}
|{{#expr:{{CURRENTYEAR}}-{{{birth_year|1980}}}-1}} }}
+
|{{#expr:{{CURRENTYEAR}}-{{{1|{{{birth_year|1980}}}}}}-1}} }}
|{{#expr:{{CURRENTYEAR}}-{{{birth_year|1980}}}}} }} }}</includeonly><noinclude>
+
|{{#expr:{{CURRENTYEAR}}-{{{1|{{{birth_year|1980}}}}}}}} }} }}</includeonly><noinclude>
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Revision as of 02:18, October 18, 2019

Export this template, then import, to install it.
Use edit summary: Copied from [[w:c:templates:Template:Age]] to properly attribute this template's editors.
This template is probably not already on your wiki.
Template documentation
Note: the template above may sometimes be partially or fully invisible.

View or edit this documentation. (How does this work?)

Editors can experiment with this template's sandbox and test case pages.
Description
This template returns the current age of someone with a given birthdate.
Sample output
{{Age
|birth_year=1929
|birth_month=1
|birth_day=15
}}
gives...
91
{{Age
|1929
|1
|15
}}
gives...
91
Community content is available under CC-BY-SA unless otherwise noted.