Template:Age for infant

From Wikipedia, the free encyclopedia

[edit] Template documentation

This template displays an age appropriate for an infant: months and days up to one year, years and months up to three years, and years beyond.

[edit] Usage

{{age for infant|abbr= yes/no|YEAROFBIRTH|MONTHOFBIRTH|DAYOFBIRTH}}
{{subst:age for infant|abbr= yes/no|YEAROFBIRTH|MONTHOFBIRTH|DAYOFBIRTH|CMPYEAR|CMPMONTH|CMPDAY}}
  • abbr - if set to yes days are displayed as "dys", months as "mos", etc., etc. If set to no or undefined, the template displays normally.
  • DATEOFBIRTH - the day the infant was born
  • MONTHOFBIRTH - the month in which the baby was born
  • YEAROFBIRTH - the year the baby was born, in four digits
  • CMPDAY - the day to compare to, rather than the current day
  • CMPMONTH - the month to compare to, rather than the current month
  • CMPYEAR - the year to compare to, rather than the current year

[edit] Examples of use

Wikipedia's current date is 2008-06-15.

  • {{age for infant|2008|5|14}} gives &&&&&&&&&&&&&0321 month 1 day [1]
  • {{age for infant|2008|1|1|abbr=yes}} gives: &&&&&&&&&&&&01665 mos 14 days
  • {{age for infant|2006|5|14}} gives &&&&&&&&&&&&07632 years 1 month [2]Template:Xpd/
  • {{age for infant|2003|1|1}} gives &&&&&&&&&&&019925 years [3]Template:Xpd/

More examples of output:

Age
&&&&&&&&&&&&01665 months 14 days
&&&&&&&&&&&&01565 months 4 days
&&&&&&&&&&&&01464 months 25 days
&&&&&&&&&&&&01354 months 14 days
&&&&&&&&&&&&01254 months 4 days
&&&&&&&&&&&&01153 months 25 days
&&&&&&&&&&&&01063 months 14 days
&&&&&&&&&&&&01063 months 14 days
&&&&&&&&&&&&&0963 months 4 days
&&&&&&&&&&&&04721 year 3 months
&&&&&&&&&&&&03801 year 0 months
&&&&&&&&&&&&07051 year 11 months
&&&&&&&&&&&010392 years 10 months
&&&&&&&&&&&&04011 year 1 month
&&&&&&&&&&&&04211 year 1 month
&&&&&&&&&&&&04421 year 2 months
&&&&&&&&&&&0484513 years
&&&&&&&&&&&0520014 years
&&&&&&&&&&&0555515 years