Template:Death date and age: Difference between revisions

From Chalo Chatu, Zambia online encyclopedia
Jump to navigationJump to search
Created page with "<includeonly>{{#if:{{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}<span style="display:none">(<span class="dday deathdate"..."
 
No edit summary
 
Line 1: Line 1:
<includeonly>{{#if:{{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}<span style="display:none">(<span class="dday deathdate">{{{1}}}-{{padleft:{{MONTHNUMBER|{{{2}}}}}|2|0}}-{{padleft:{{{3}}}|2|0}}</span>)</span> (aged&nbsp;{{#if:{{{5|}}}
<onlyinclude>
  |{{#if:{{{6|}}}
{{#if:{{{1|}}}
  |<!-- if all birth values are specified -->{{age|{{{4}}}|{{{5}}}|{{{6}}}|{{{1}}}|{{{2}}}|{{{3}}}}}
| {{{1}}} {{{2}}}, {{{3}}} (aged {{#expr:{{{3}}} - {{{4}}}}})
  |{{#ifexpr:{{{2}}}<{{{5}}}
  | <!-- no output if blank -->
    |<!-- if birth month but not day exist and birth month was not reached in death year -->{{age|{{{4}}}|12|31|{{{1}}}|{{{2}}}|{{{3}}}}}
}}
    |{{#ifexpr:{{{2}}}>{{{5}}}<!-- if birth month but not day exist and birth month was reached in death year -->
</onlyinclude>
    |{{age|{{{4}}}|1|1|{{{1}}}|{{{2}}}|{{{3}}}}}
 
    |<!-- if birth month but not day exist and birth month is the death month -->{{age|{{{4}}}|12|31|{{{1}}}|{{{2}}}|{{{3}}}}}–{{age|{{{4}}}|1|1|{{{1}}}|{{{2}}}|{{{3}}}}}
<noinclude>
    }}
== Usage ==
  }}
This template displays a formatted death date along with age at death. Use only year-based approximation. This is ideal for Chalo Chatu biographies where full dates are not always known.
  }}
 
|{{Age in years|{{{4}}}|{{{1}}}}}}})<!--
=== Syntax ===
-- Error checks --
<pre>
-->{{#ifexpr: ( {{{1|}}} > {{CURRENTYEAR}} ) OR ( {{{4|}}} > {{CURRENTYEAR}} ) OR ( {{{4|}}} > {{{1|}}} ) OR ( {{{1|}}} - {{{4|}}} > 150 )
{{death date and age|day|month|year of death|year of birth}}
| &#32;{{error|invalid year}}{{main other|[[Category:Pages using age template with invalid date]]}}
</pre>
}}{{#if:{{{5|}}}|{{#ifexpr: ( {{{2|}}} > 12 ) OR ( {{{2|}}} < 1 ) OR ( {{{5|}}} > 12 ) OR ( {{{5|}}} < 1 )
 
| &#32;{{error|invalid month}}{{main other|[[Category:Pages using age template with invalid date]]}}|}}
=== Example ===
}}{{#if:{{{6|}}}|{{#ifexpr: ( {{{3|}}} > 31 ) OR ( {{{3|}}} < 1 ) OR ( {{{6|}}} > 31 ) OR ( {{{6|}}} < 1 )
<pre>
| &#32;{{error|invalid day}}{{main other|[[Category:Pages using age template with invalid date]]}}|}}
{{death date and age|4|March|1989|1919}}
}}</includeonly><noinclude>
</pre>
{{documentation}}
 
=== Output ===
4 March 1989 (aged 70)
 
=== Notes ===
* If exact birth and death **months and days** are available, use `{{death date full}}` instead.
* This version is simplified for use without Lua or `#time` functions.
 
[[Category:Templates for biography dates]]
</noinclude>
</noinclude>

Latest revision as of 06:03, 29 September 2025



Usage

This template displays a formatted death date along with age at death. Use only year-based approximation. This is ideal for Chalo Chatu biographies where full dates are not always known.

Syntax

{{death date and age|day|month|year of death|year of birth}}

Example

{{death date and age|4|March|1989|1919}}

Output

4 March 1989 (aged 70)

Notes

  • If exact birth and death **months and days** are available, use `Template:Death date full` instead.
  • This version is simplified for use without Lua or `#time` functions.