Module:Age/doc
Appearance
![]() | This is a documentation subpage for Module:Age. It may contain usage information, categories and other content that is not part of the original module page. |
Module:Age implements the following templates:
Template | Required wikitext |
---|---|
{{extract}} | {{#invoke:age|extract}}
|
{{gregorian serial date}} | {{#invoke:age|gsd}}
|
{{JULIANDAY}} | {{#invoke:age|JULIANDAY}}
|
{{time interval}} | {{#invoke:age|time_interval}}
|
{{age in days}} | {{#invoke:age|age_generic|template=age_days}}
|
{{age in days nts}} | {{#invoke:age|age_generic|template=age_days_nts}}
|
{{duration in days}} | {{#invoke:age|age_generic|template=duration_days}}
|
{{duration in days nts}} | {{#invoke:age|age_generic|template=duration_days_nts}}
|
{{age}} | {{#invoke:age|age_generic|template=age_full_years}}
|
{{age nts}} | {{#invoke:age|age_generic|template=age_full_years_nts}}
|
{{age in years}} | {{#invoke:age|age_generic|template=age_in_years}}
|
{{age in years nts}} | {{#invoke:age|age_generic|template=age_in_years_nts}}
|
{{age for infant}} | {{#invoke:age|age_generic|template=age_infant}}
|
{{age in months}} | {{#invoke:age|age_generic|template=age_m}}
|
{{age in weeks}} | {{#invoke:age|age_generic|template=age_w}}
|
{{age in weeks and days}} | {{#invoke:age|age_generic|template=age_wd}}
|
{{age in years and days}} | {{#invoke:age|age_generic|template=age_yd}}
|
{{age in years and months}} | {{#invoke:age|age_generic|template=age_ym}}
|
{{age in years, months and days}} | {{#invoke:age|age_generic|template=age_ymd}}
|
{{age in years, months, weeks and days}} | {{#invoke:age|age_generic|template=age_ymwd}}
|
The age templates expect the older date to be first. The implementations of age_in_years
and age_in_years_nts
display an error message if that is not the case. If similar checking is wanted for other templates, negative=error
can be added to the invoke. For example, {{age}} might use:
{{#invoke:age|age_generic|template=age_full_years|negative=error}}
If negative=error
does not apply, a negative difference is indicated with a minus sign (−).
Dates can use numbered or named parameters to specify year/month/day. Alternatively, a full date can be entered in a variety of formats. For example:
{{age in years and months|year1=2001|month1=1|day1=10|year2=2012|month2=2|day2=20}}
→ 11 years, 1 month{{age in years and months|year=2001|month=1|day=10|year2=2012|month2=2|day2=20}}
→ 11 years, 1 month{{age in years and months|2001|1|10|2012|2|20}}
→ 11 years, 1 month{{age in years and months|2001-1-10|2012-2-20}}
→ 11 years, 1 month{{age in years and months|10 Jan 2001|20 Feb 2012}}
→ 11 years, 1 month{{age in years and months|January 10, 2001|Feb 20, 2012}}
→ 11 years, 1 month
If the first or second date is omitted, the current date is used. For example:
{{age in years and months|year2=2012|month2=2|day2=20}}
→ −13 years, 3 months{{age in years and months|year2=2012|month2=2|day2=20}}
→ −13 years, 3 months{{age in years and months||||2012|2|20}}
→ −13 years, 3 months{{age in years and months||2012-2-20}}
→ −13 years, 3 months{{age in years and months||20 Feb 2012}}
→ −13 years, 3 months{{age in years and months||Feb 20, 2012}}
→ −13 years, 3 months{{age in years and months|year1=2001|month1=1|day1=10}}
→ 24 years, 4 months{{age in years and months|year=2001|month=1|day=10}}
→ 24 years, 4 months{{age in years and months|2001|1|10}}
→ 24 years, 4 months{{age in years and months|2001-1-10}}
→ 24 years, 4 months{{age in years and months|10 Jan 2001}}
→ 24 years, 4 months{{age in years and months|January 10, 2001}}
→ 24 years, 4 months