"टेम्पलेट:Age in years, months and days" की अवतरण में अंतर

allowing an end date to be specified and making the serial comma an opt in
छो (Changed protection level of Template:For year month day: Highly visible template: allow template editors ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
(allowing an end date to be specified and making the serial comma an opt in)
{{#if:{{#ifeq:{{{6|¤}}}|¤||1}}{{#ifeq:{{{5|¤}}}|¤||1}}{{#ifeq:{{{4|¤}}}|¤||1}}
{{#if:{{{year|}}}
|{{#ififerror:{{{month#time:Y-m-d|{{{6}}}-{{{5}}}-{{{4}}}}}
|{{#if:{{{dayerror|}Error: Invalid time. }}
|}}}}{{#if:{{{1|{{{year|}}}}}}
|{{#if:{{{2|{{{month|}}}}}}
|{{#exprif:{{CURRENTDAY}}-{3|{{{day|}}}}}}
|{{For year month day/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|0
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}<{{{2|{{{month}}}}}}
|1
|{{#ifexpr:{{{6|{{CURRENTDAY}}>=}}}<{{{3|{{{day}}}}}}
|0
|1
|0
}}
}}
}}}}
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+{{#ifexpr:{{{6|{{CURRENTDAY}}>=}}}<{{{3|{{{day}}}}}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>={{{2|{{{month}}}}}}
|0
|12
}}
|{{#ifexpr:{{CURRENTMONTH}}>{{{month}}}
|-1
|11
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}>}}}<{{{2|{{{month}}}}}}
}}}}
|12
|days={{#ifexpr:{{CURRENTDAY}}>={{{day}}}
|0
|{{#expr:{{CURRENTDAY}}-{{{day}}}
}}
}}{{#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}}-1}}}-{{#ifexpr:{{Gregorian serial date
|dayyear={{{day4|{{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&nbsp;years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}}&nbsp;or {{For year month day/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
|{{#ifexpr:{{{5|{{CURRENTMONTH}}}}}>{{{2|{{{month}}}}}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|<!--null value-->
|{{For year month day/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}} and
}} {{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}-1}}&nbsp;or {{For year month day/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{#expr:{{{1|{{{year}}}}}}+1}}
|<!--null value-->
|{{For year month day/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}}
}} and
}} {{#expr:{{CURRENTMONTH}}-{5|{{monthCURRENTMONTH}}}+11}}&nbsp;or -{{#expr:{{CURRENTMONTH}}-2|{{{month}}}}}}+1211}}&nbsp;monthsor {{For year month day/display
|months={{#expr:{{{5|{{CURRENTMONTH}}}}}-{{{2|{{{month}}}}}}+12}}}}
}}
}}
}}
|{{#ifexpr:{{{4|{{CURRENTYEAR}}}}}={{{1|{{{year}}}}}}
|0&nbsp;years
|{{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}-1}}&nbsp;or {{For year month day/display
|years={{#expr:{{{4|{{CURRENTYEAR}}}}}-{{{1|{{{year}}}}}}}}
}}
}}
नामालूम प्रयोगकर्ता