Template:Age: Difference between revisions

The Emma M. Lion Wiki
Created page with "<includeonly>{{#if: {{{deathday|}}} | {{#expr: {{#time: U|{{{deathday}}}}} - {{#time: U|{{{birthday}}}}} / 31557600 }} years | {{#expr: {{#time: U|1884-08-01}}} - {{#time: U|{{{birthday}}}}} / 31557600 }} years }} </includeonly> {{#if: {{{deathday|}}} | {{#time: F|{{{birthday}}}}} - {{#time: F|{{{deathday}}}}} <small> ({{#expr: {{#time: U|{{{deathday}}}}} - {{#time: U|{{{birthday}}}}} / 31557600 }})</small> | {{#time: F|{{{birthday}}}}} <small> ({{#ex..."
 
updated template data
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#if: {{{deathday|}}} |  
<includeonly>{{#if: {{{2|}}}  
  {{#expr: {{#time: U|{{{deathday}}}}} - {{#time: U|{{{birthday}}}}} / 31557600 }} years
| {{#expr: floor(({{#time: U|{{{2}}}}} - {{#time: U|{{{1}}}}}) / 31557600) }}
  |  
| {{#expr: floor(({{#time: U|1884-08-01}} - {{#time: U|{{{1}}}}}) / 31557600) }}
  {{#expr: {{#time: U|1884-08-01}}} - {{#time: U|{{{birthday}}}}} / 31557600 }} years }} </includeonly>
}}</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}}.


{{#if: {{{deathday|}}} |
<templatedata>
  {{#time: F|{{{birthday}}}}} - {{#time: F|{{{deathday}}}}}
{
  <small> ({{#expr: {{#time: U|{{{deathday}}}}} - {{#time: U|{{{birthday}}}}} / 31557600 }})</small>
    "description": "",
  |
    "params": {
  {{#time: F|{{{birthday}}}}} <small> ({{#expr: {{#time: U|1884-08-01}} - {{#time: U|{{{birthday}}}}} / 31557600 }})</small> }}
        "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:
{{Age|1863-01-13}}
 
Example with a deathdate:
{{Age|1853-07-15|1873-10-03}}
 
 
</noinclude>

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