Template:Death date and agePhin: Difference between revisions

From MicrasWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{death-date
<includeonly>{{#if:{{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{RP|{{{1}}}}}<span style="display:none">(<span class="dday deathdate">{{RP|{{{1}}}}}-{{padleft:{{MONTHNUMBER|{{{2}}}}}|2|0}}-{{padleft:{{{3}}}|2|0}}</span>)</span> (aged&nbsp;{{#if:{{{5|}}}
|dt = {{{dt|}}}
|{{#if:{{{6|}}}
|{{{gregorian|{{{1|}}} }}}
  |<!-- if all birth values are specified -->{{age|{{{4}}}|{{{5}}}|{{{6}}}|{{{1}}}|{{{2}}}|{{{3}}}}}
|{{{3|{{{1|}}}}}}}} (aged&nbsp;{{age|{{#ifeq:"{{lc:{{{2|0009-11}}}}}"|"{{padleft:{{#expr:{{{2|0009-11}}}}}|4|0}}"|<!--Here if it is a 4 digit year only-Test1 satisfied: see talk -->{{{2|0009-11}}}|{{#expr: {{#iferror:{{#ifexpr:((abs({{{2|0009-11}}}))< 1900) and  ({{#time:Y|{{{2|0009-11}}}}} >1900)  | {{#ifexpr:({{#time:Y|{{{2|0009-11}}}}}) <2000|{{#expr:{{#time:Y|{{{2|0009-11}}}}}-1900}}|{{#expr:{{#time:Y|{{{2|0009-11}}}}}-2000}} }} |{{#time:Y|{{{2|0009-11}}}}} }}|{{#time:Y|{{{2|0009-11}}}}} }}{{#switch:{{{bce|}}}|b|d|bd|db=*(-1) +1}}}} }}|{{#time:m|{{{2|}}}}}|{{#time:d|{{{2|}}}}}|{{#ifeq:"{{lc:{{{1|0009-11}}}}}"|"{{padleft:{{#expr:{{{1|0009-11}}}}}|4|0}}"|<!--Here if it is a 4 digit year only-Test1 satisfied: see talk -->{{{1|0009-11}}}|{{#expr: {{#iferror:{{#ifexpr:((abs({{{1|0009-11}}}))< 1900) and  ({{#time:Y|{{{1|0009-11}}}}} >1900)  | {{#ifexpr:({{#time:Y|{{{1|0009-11}}}}}) <2000|{{#expr:{{#time:Y|{{{1|0009-11}}}}}-1900}}|{{#expr:{{#time:Y|{{{1|0009-11}}}}}-2000}} }} |{{#time:Y|{{{1|0009-11}}}}} }}|{{#time:Y|{{{1|0009-11}}}}} }}{{#switch:{{{bce|}}}|bd|d|db=*(-1) +1}}}} }}|{{#time:m|{{{1|}}}}}|{{#time:d|{{{1|}}}}} }}){{#invoke:check for unknown parameters|check|unknown=[[Category:Death-date and age transclusions with invalid parameters|_VALUE_]]|preview=unknown parameter "_VALUE_"|1|2|3|dt|gregorian|bce}}</includeonly><noinclude>
  |{{#ifexpr:{{{2}}}<{{{5}}}
    |<!-- 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 -->
    |{{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}}}}}
    }}
  }}
  }}
|{{Age in years|{{{4}}}|{{{1}}}}}}})<!--
-- Error checks --
-->{{#ifexpr: ( {{{1|}}} > {{CURRENTYEAR}} ) OR ( {{{4|}}} > {{CURRENTYEAR}} ) OR ( {{{4|}}} > {{{1|}}} ) OR ( {{{1|}}} - {{{4|}}} > 150 )
  | &#32;{{error|invalid year}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#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]]}}|}}
}}{{#if:{{{6|}}}|{{#ifexpr: ( {{{3|}}} > 31 ) OR ( {{{3|}}} < 1 ) OR ( {{{6|}}} > 31 ) OR ( {{{6|}}} < 1 )
| &#32;{{error|invalid day}}{{main other|[[Category:Pages using age template with invalid date]]}}|}}
}}</includeonly><noinclude>[[Category:Date templates]]
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Latest revision as of 21:30, 18 August 2021

[create] Template documentation