Changes
Template:Age in years months and days (view source)
Revision as of 06:44, 16 October 2018
, 6 years agoper cfd
{{#if:{{#ifeq:{{{6|¤}}}|¤||1}}{{#ifeq:{{{5|¤}}}|¤||1}}{{#ifeq:{{{4|¤}}}|¤||1}}
|{{#iferror:{{#time:Y-m-d|{{{6}}}-{{{5}}}-{{{4}}}}}
|{{error|Error: Invalid time. }}
|}}}}{{#if:{{{1|{{{year|}}}}}}
|{{#if:{{{2|{{{month|}}}}}}
|{{#if:{{{3|{{{day|}}}}}}
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|0
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}<{{{2|{{{month}}}}}}
|1
|{{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|1
|0
}}
}}
}}}}
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+{{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|-1
|11
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}<{{{2|{{{month}}}}}}
|12
|0
}}
}}{{#ifexpr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-1}}
|day={{{3|{{{day}}}}}}
}}<0
|-1
|<!--null value-->
}}}}
|days={{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|{{#expr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{#ifexpr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-1}}
|day={{{3|{{{day}}}}}}
}}<0
|2
|1
}}}}
|day={{{3|{{{day}}}}}}
}}}}
|{{#expr:{{{6|{{CURRENTDAY}}}}}-{{{3|{{{day}}}}}}
}}
}}
|sc={{#switch:{{{sc|}}}
|N|n|No|no|False|false|Off|off=<!--null value-->
|#default={{{sc|}}}
}}
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}={{{2|{{{month}}}}}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|0 years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}} or {{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|<!--null value-->
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}} and
}} {{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}-1}} or {{Age in years months and days/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{#expr:{{{1|{{{year}}}}}}+1}}
|<!--null value-->
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}}
}} and
}} {{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+11}} or {{Age in years months and days/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+12}}}}
}}
}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|0 years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}} or {{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
}}
|some time
}}<noinclude>{{documentation}}
[[Category:Intricate templates]]
[[Category:Templates using TemplateData]]
[[Category:Date-computing templates]]
[[Category:Date mathematics templates]]
</noinclude>
|{{#iferror:{{#time:Y-m-d|{{{6}}}-{{{5}}}-{{{4}}}}}
|{{error|Error: Invalid time. }}
|}}}}{{#if:{{{1|{{{year|}}}}}}
|{{#if:{{{2|{{{month|}}}}}}
|{{#if:{{{3|{{{day|}}}}}}
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|0
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}<{{{2|{{{month}}}}}}
|1
|{{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|1
|0
}}
}}
}}}}
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+{{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|-1
|11
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}<{{{2|{{{month}}}}}}
|12
|0
}}
}}{{#ifexpr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-1}}
|day={{{3|{{{day}}}}}}
}}<0
|-1
|<!--null value-->
}}}}
|days={{#ifexpr:{{{6|{{CURRENTDAY}}}}}<{{{3|{{{day}}}}}}
|{{#expr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{#ifexpr:{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{{5|{{CURRENTMONTH}}}}}
|day={{{6|{{CURRENTDAY}}}}}}}-{{Gregorian serial date
|year={{{4|{{CURRENTYEAR}}}}}
|month={{#expr:{{{5|{{CURRENTMONTH}}}}}-1}}
|day={{{3|{{{day}}}}}}
}}<0
|2
|1
}}}}
|day={{{3|{{{day}}}}}}
}}}}
|{{#expr:{{{6|{{CURRENTDAY}}}}}-{{{3|{{{day}}}}}}
}}
}}
|sc={{#switch:{{{sc|}}}
|N|n|No|no|False|false|Off|off=<!--null value-->
|#default={{{sc|}}}
}}
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}={{{2|{{{month}}}}}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|0 years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}} or {{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|<!--null value-->
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}} and
}} {{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}-1}} or {{Age in years months and days/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{#expr:{{{1|{{{year}}}}}}+1}}
|<!--null value-->
|{{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}}
}} and
}} {{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+11}} or {{Age in years months and days/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+12}}}}
}}
}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|0 years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}} or {{Age in years months and days/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
}}
|some time
}}<noinclude>{{documentation}}
[[Category:Intricate templates]]
[[Category:Templates using TemplateData]]
[[Category:Date-computing templates]]
[[Category:Date mathematics templates]]
</noinclude>