Module:Age/doc

From Magic: The Gathering Wiki
Jump to navigation Jump to search

This is the documentation page for Module:Age

This is a module documentation subpage for Module:Age.
It contains usage information, categories, interlanguage links and other content that is not part of the original module page.
Description
This module calculates age information from given years, with support for approximate years (using c. or {{circa}}).
It provides five functions:
  • age – returns only the age range (e.g. "63–64").
  • ageInYears – returns the age as a single value with "years" (e.g. "64 years" or "approx. 64 years"). Can take one parameter (birth year) or two parameters (birth year and reference year).
  • birthDateAndAge – returns the birth year (or c. year) followed by the age in parentheses.
  • deathDateAndAge – returns the death year (or c. year) followed by the age at death in parentheses.
  • startDateAndAge – returns the start year (or c. year) followed by how many years ago in parentheses.
Usage
  • {{#invoke:Age|age|YEAR}}
  • {{#invoke:Age|ageInYears|BIRTH_YEAR}}
  • {{#invoke:Age|ageInYears|BIRTH_YEAR|REFERENCE_YEAR}}
  • {{#invoke:Age|birthDateAndAge|YEAR}}
  • {{#invoke:Age|deathDateAndAge|BIRTH|DEATH}}
  • {{#invoke:Age|startDateAndAge|YEAR}}
Sample output

Age

{{#invoke:Age|age|4500}}approx. 64

{{#invoke:Age|age|c. 4500}}approx. 64

{{#invoke:Age|age|{{circa}} 4500}}approx. 64

Age in years

{{#invoke:Age|ageInYears|4500}}approx. 64 years

{{#invoke:Age|ageInYears|c. 4500}}approx. 64 years

{{#invoke:Age|ageInYears|4500|4560}} → 60 years

{{#invoke:Age|ageInYears|c. 4500|4560}}approx. 60 years

{{#invoke:Age|ageInYears|4500|c. 4560}}approx. 60 years

Birth date and age

{{#invoke:Age|birthDateAndAge|4500}} → 4500 AR (age approx. 64)

{{#invoke:Age|birthDateAndAge|c. 4500}}c. 4500 AR (age approx. 64)

{{#invoke:Age|birthDateAndAge|{{circa}} 4500}}c. 4500 AR (age approx. 64)

Death date and age

{{#invoke:Age|deathDateAndAge|100|200}} → 200 AR (aged 99–100)

{{#invoke:Age|deathDateAndAge|c. 100|200}} → 200 AR (aged approx. 100)

{{#invoke:Age|deathDateAndAge|100|c. 200}}c. 200 AR (aged approx. 100)

Start date and age

{{#invoke:Age|startDateAndAge|1000}} → 1000 AR (approx. 3564 years ago)

{{#invoke:Age|startDateAndAge|c. 1000}}c. 1000 AR (approx. 3564 years ago)

{{#invoke:Age|startDateAndAge|{{circa}} 1000}}c. 1000 AR (approx. 3564 years ago)