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 1 month 1 day [1]- {{age for infant|2008|1|1|abbr=yes}} gives: 5 mos 14 days
{{age for infant|2006|5|14}}
gives 2 years 1 month [2]{{age for infant|2003|1|1}}
gives 5 years [3]
More examples of output:
Age |
---|
5 months 14 days |
5 months 4 days |
4 months 25 days |
4 months 14 days |
4 months 4 days |
3 months 25 days |
3 months 14 days |
3 months 14 days |
3 months 4 days |
1 year 3 months |
1 year 0 months |
1 year 11 months |
2 years 10 months |
1 year 1 month |
1 year 1 month |
1 year 2 months |
13 years |
14 years |
15 years |