Template:Age: Difference between revisions

The Emma M. Lion Wiki
changed 'deathday' to 'deathdate'
updated template data
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<includeonly>{{#if: {{{2|}}}
A template to display an person's birthday and age, with an option to account for deaths. The template will show the age from the start of the next (yet-to-be-published) book. Currently this is {{Friendly Date|date=1884-08-01}}.
| {{#expr: floor(({{#time: U|{{{2}}}}} - {{#time: U|{{{1}}}}}) / 31557600) }}
| {{#expr: floor(({{#time: U|1884-08-01}} - {{#time: U|{{{1}}}}}) / 31557600) }}
}}</includeonly><noinclude>
A template to display an person's age, with an option to account for deaths. The template will show the age from the start of the next (yet-to-be-published) book. Currently this is {{Friendly Date|date=1884-08-01}}.


<templatedata>
{
    "description": "",
    "params": {
        "1": {
            "label": "Birthday",
            "description": "The birthday.",
            "type": "string",
            "required": true
        },
        "2": {
            "label": "Date of Death",
            "description": "The date of death.",
            "type": "string",
            "required": false
        }
    }
}
</templatedata>


Example with no deathdate:
Example with no deathdate:
{{Age|birthday=1863-01-13}}
{{Age|1863-01-13}}


Example with a deathdate:
Example with a deathdate:
{{Age|birthday=1853-07-15|deathdate=1873-10-03}}
{{Age|1853-07-15|1873-10-03}}
 
 
</noinclude>
</noinclude>
{{#if: {{{deathdate|}}}
| {{Friendly Date|date={{{birthday}}}}} - {{Friendly Date|date={{{deathdate}}}}} ({{#expr: floor(({{#time: U|{{{deathdate}}}}} - {{#time: U|{{{birthday}}}}}) / 31557600) }})
| {{Friendly Date|date={{{birthday}}}}} ({{#expr: floor(({{#time: U|1884-08-01}} - {{#time: U|{{{birthday}}}}}) / 31557600) }})
}}

Latest revision as of 17:28, 3 February 2025

A template to display an person's age, with an option to account for deaths. The template will show the age from the start of the next (yet-to-be-published) book. Currently this is August 1, 1884.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Birthday1

The birthday.

Stringrequired
Date of Death2

The date of death.

Stringoptional

Example with no deathdate: 21

Example with a deathdate: 20