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

update to handle few or no outputs, per protected edit request
(Calculation fix per protected edit request)
(update to handle few or no outputs, per protected edit request)
{{#if:{{{year|}}}
{{For year month day/display
|{{#switchif:{{{month|{{CURRENTMONTH}}}}}
|years={{#expr:{{CURRENTYEAR}}-{{{year|{{CURRENTYEAR}}}}}-{{#ifexpr:{{CURRENTMONTH}}>{{{month|{{CURRENTMONTH}}}}}
|{{#if:{{{day|}}}
|0
|{{For year month day/display
|{{#ifexpr:{{CURRENTMONTH}}<{{{month|{{CURRENTMONTH}}}}}
|years={{#expr:{{CURRENTYEAR}}-{{{year|{{CURRENTYEAR}}}}}-{{#ifexpr:{{CURRENTMONTH}}>{{{month|{{CURRENTMONTH}}}}}
|1
|0
|{{#ifexpr:{{CURRENTDAY}}>={{{day|{{CURRENTDAY}}}}}
|{{#ifexpr:{{CURRENTMONTH}}<{{{month}}}
|0
|1
|{{#ifexpr:{{CURRENTDAY}}>={{{day|{{CURRENTDAY}}}}}
|0
|1
}}
}}
}}}}
|daysmonths={{#expr:{{CURRENTDAYCURRENTMONTH}}-{{{day|{{CURRENTDAY}}month}}}+{{#ifexpr:{{CURRENTDAY}}>={{{day|{{CURRENTDAY}}}}}
|{{#ifexpr:{{CURRENTMONTH}}>={{{month|{{CURRENTMONTH}}}}}
|0
|12
}}
|{{#ifexpr:{{CURRENTMONTH}}>{{{month}}}
|-1
|11
}}
}}}}
|days={{#ifexpr:{{CURRENTDAY}}>={{{day}}}
|{{#expr:{{CURRENTDAY}}-{{{day}}}
}}
|{{#expr:{{Gregorian serial date
|year={{CURRENTYEAR}}
|month={{CURRENTMONTH}}
|day={{CURRENTDAY}}}}-{{Gregorian serial date
|year={{CURRENTYEAR}}
|month={{#expr:{{CURRENTMONTH}}-1}}
|day={{{day}}}
}}}}
|29 }}
|28}}
|{{#ifexpr:{{CURRENTMONTH}}<={{{month|{{CURRENTMONTH}}}}}
|{{#ifexpr:{{CURRENTYEAR}}={{{year}}}
|0&nbsp;years
|{{#expr:{{CURRENTYEAR}}-{{{year}}}-1}}&nbsp;or {{For year month day/display
|years={{#expr:{{CURRENTYEAR}}-{{{year}}}}}
}}
}}
|{{#ifexpr:{{CURRENTMONTH}}>{{{month}}}
|{{#ifexpr:{{CURRENTYEAR}}={{{year}}}
|<!--null value-->
|{{For year month day/display
|years={{#expr:{{CURRENTYEAR}}-{{{year}}}}}
}} and
}} {{#expr:{{CURRENTMONTH}}-{{{month}}}-1}}&nbsp;or {{For year month day/display
|months={{#expr:{{CURRENTMONTH}}-{{{month}}}}}
}}
|{{#ifexpr:{{CURRENTYEAR}}={{#expr:{{{year}}}+1}}
|<!--null value-->
|{{For year month day/display
|years={{#expr:{{CURRENTYEAR}}-{{{year}}}-1}}
}} and
}} {{#expr:{{CURRENTMONTH}}-{{{month}}}+11}}&nbsp;or {{#expr:{{CURRENTMONTH}}-{{{month}}}+12}}&nbsp;months
}}
}}
}}
|{{#ifexpr:{{CURRENTYEAR}}={{{year}}}
}}
|0&nbsp;years
}}}}
|months={{#expr:{{CURRENTMONTHCURRENTYEAR}}-{{{month|{{CURRENTMONTHyear}}}-1}}+{{#ifexpr:{{CURRENTDAY}}>={&nbsp;or {{For year month day|{{CURRENTDAY}}}}}/display
|years={{#ifexprexpr:{{CURRENTMONTHCURRENTYEAR}}>=-{{{month|{{CURRENTMONTHyear}}}}}
|0 }}
|12
}}
|{{#ifexpr:{{CURRENTMONTH}}>{{{month|{{CURRENTMONTH}}}}}
|-1
|11
}}
}}}}
|days={{#expr:{{CURRENTDAY}}-{{{day|{{CURRENTDAY}}}}}+{{#ifexpr:{{CURRENTDAY}}>={{{day|{{CURRENTDAY}}}}}
|0
|{{#switch:{{{month|{{CURRENTMONTH}}}}}
|4|6|9|11=30
|1|3|5|7|8|10|12=31
|2={{#ifexpr:{{CURRENTYEAR}}mod400=0 or ({{CURRENTYEAR}}mod4=0 and {{CURRENTYEAR}}mod100>0)
|29
|28
}}
}}
|some time
}}}}
}}<noinclude>{{documentationDocumentation}}</noinclude>
नामालूम प्रयोगकर्ता