Template:Days since: Difference between revisions

m create documentation subpage
 
imported>JPxG
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<noinclude><!--
<noinclude><!--
-========================================================================
-========================================================================
-  Days since: Show years/days or months/days since date: year|month|day
-  Days between the last-edited date of a page, and a date formatted as %Y %b $d (four-digit year, month name, and day).
-  Day can be zero-padded or not. Month MUST be supplied as "Feb" or "February".
-  This won't work for timestamps with numbers (like "1969 12 31").
-========================================================================
-========================================================================
--></noinclude>{{
--></noinclude><includeonly>{{#ifexist:{{{3|}}}<!--
#ifeq: {{{2|xnone<noinclude>more</noinclude>}}}|xnone|
 
  <br>{{color|darkorange|'''{Days since}: Expected 3 numbers: year{{!}}month{{!}}day, but found: {{{1}}}'''<br>}}
If three parameters are supplied, parse them as "YYYY", "MM", and "DD", and supply them as "DD Month YYYY".
}}{{
-->|{{Time ago|{{{3}}} {{MONTHNAME|{{{2}}}}} {{{1}}}|magnitude=days|ago=|numeric=y}}<!--
#ifexpr: {{age in days|{{{1|2011}}}|{{{2|3}}}|{{{3|4}}}}} > 365
 
| {{#expr: floor( {{age in days|{{{1|2011}}}|{{{2|3}}}|{{{3|4}}}}} / 365) }}&nbsp;years, {{#expr: {{age in days|{{{1|2011}}}|{{{2|3}}}|{{{3|4}}}}} mod 365}}&nbsp;days
If one parameter is supplied, parse and supply it as "DD Month YYYY".
| {{#ifexpr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} > 30
-->|{{Time ago|{{{1}}}|magnitude=days|ago=|numeric=y}}<!--
| {{#expr: floor{{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} / 30}}}}{{#ifeq: {{{short|}}} | yes | m | &nbsp;months ago }}
-->}}</includeonly>
| {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}{{#ifeq: {{{short|}}} | yes | d | &nbsp;days ago }}
<noinclude>
}}
}}<noinclude>
{{Documentation}}
{{Documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
</noinclude>