Template:Start date and age: Difference between revisions

m
108 revisions imported from wikipedia:Template:Start_date_and_age
(Fix calculation of years or months ago when input is year/month (no day) or year only (no month or day). Previously implemented in /sandbox and tested in /testcases.)
m (108 revisions imported from wikipedia:Template:Start_date_and_age)
 
(18 intermediate revisions by 12 users not shown)
Line 6:
-->|{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{#ifeq: {{yesno|{{{df|no}}}}}|yes<!--
-->|{{#expr:{{{3}}}}}&nbsp;{{MONTHNAME|{{{2}}}}}<!--
-->|{{MONTHNAME|{{{2}}}}}&nbsp;{{#expr:{{{3}}}}},<!--
Line 14:
-->|{{{1}}}<!--
-->}}<!--
--><span class="noprint">{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes||&#059;}}<!--
-->{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br/>|&#032;}}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|(}}<!--
-->{{#if: {{{32|}}}<!--
-->|{{time#if: ago|{{{1}}}-{{{2}}}-{{{3|}}}|min_magnitude=days}}<!--
-->|{{#if:time ago|{{{1}}}-{{{2|}}}-{{{3}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{{1}}}|{{#time:n|1-{{trim|{{{2}}}}}-1}}}}<!--
-->|{{years or months ago|{{{1}}}}}<!--
-->|{{#iferror:{{#expr:{{{1}}}}}<!--
-->|{{time ago|{{{1}}}|min_magnitude=days}}<!--
-->|{{#ifeq:years or months ago|{{{paren|1}}}|yes|)}}</span><!--
-->}}<!--
-->|'''{{color|red|Error: No parameters}}'''<!--
-->}}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|)}}</span><!--
-->|{{Error|Error: first parameter is missing.|tag=span}}<!--
-->}}<!--
 
IMPLEMENTATION OF microformat date classes
 
--><span style="display:none">&#160;(<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!--
-->{{#if: {{{1|}}}<!--
-->|{{{1}}}<!--
-->{{#if: {{{2|}}}<!--
-->| -{{padleft#time:m|1-{{trim|{{{2}}}|2|0}}-1}}<!--
-->{{#if: {{{3|}}}<!--
-->| -{{padleft:{{{3}}}|2|0}}<!--
Line 41 ⟶ 44:
-->}}<!--
--></span>)</span></includeonly><noinclude>
{{being merged|2013 July 31|merge=Template:Start date and years ago}}
{{documentation}}
</noinclude>