Module:Age range/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Purpose

[edit source]

This module provides a simple way to display an automatically updating age range when only an approximate birth year is known (e.g. "1991/1992"). It is designed to be used when the exact year of birth is uncertain but falls within a known range of two consecutive years.

Invoke the module using:

{{#invoke:Age range|ageRange|<earlier year>|<later year>}}

Example:

Born 1991/1992 (age {{#invoke:Age range|ageRange|1991|1992}})

As of 2026, this would output:

Born 1991/1992 (age 33–34)

Parameters

[edit source]
  • 1 – The earlier possible year of birth (e.g. 1991)
  • 2 – The later possible year of birth (e.g. 1992)

Returns

[edit source]

A string in the format:

  • 33 if both years produce the same age
  • 33–34 if the years produce a range of ages

Examples

[edit source]
Wikitext Output (as of 2026)
36 36
34–35 34–35
40–41 40–41

See also

[edit source]
  • This module assumes birth has already occurred this year.
  • Does not account for specific months or days.
  • Use only when the birth year is narrowed to two possibilities.

Module code

[edit source]

See Module:Age range for implementation.