User:Rich Farmbrough/Template:Birth event age
Appearance
- This template is to format birth, death/event and ages.
- If the either date isn't given the current date is used.
- An optional format string determines which are displayed of birth, event and age, and in which order. The most likely combinations are supported.
- The keys are B or b for birth, D, d, E or E for death or event, and A or a for age.
- The template uses "age of infant" template so that ages are displayed as months and days up to one year, years and months up to three years, and years beyond.
- the dates can be displayed in international format (df=y), pseudo ISO format (iso=y) or month first format (default).
Usage
[edit]- {{Birth event age|BDA|1962|04|10|1969|7|20|df=y}}
10 April 1962 – 20 July 1969 (age 7 years)
- {{Birth event age|bea|1962|04|10|df=y}}
10 April 1962 – 29 December 2024 (age 62 years)
- {{Birth event age|b|1962|04|10|iso=y}}
1962-04-10
- {{Birth event age|ba|1962|04|10|df=y}}
10 April 1962 (age 62 years)
Example
[edit]Cut and paste can be used to reduce error, with just the format strings changed
born = {{Birth event age|b|1962|04|10|1969|7|20|df=y}}
died = {{Birth event age|ea|1962|04|10|1969|7|20|df=y}}
displays as
born = 10 April 1962
died = 20 July 1969 (age 7 years)
See also
[edit][[Category:Date mathematics templates]]