Difference between revisions of "Template:Days from now"

From blackwiki
Jump to navigation Jump to search
imported>Gary
(add a value)
imported>Gary
(whoops, remove fixed value)
Line 1: Line 1:
<includeonly>{{#ifexpr: {{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1}} > 60 | {{#expr: floor{{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1 / 30 }}}} months | {{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1}} {{#if: {{{highlight|yes}}} | '''days''' | days }}}}</includeonly><noinclude>{{documentation}}</noinclude>
+
<includeonly>{{#ifexpr: {{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1}} > 60 | {{#expr: floor{{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1 / 30 }}}} months | {{#expr: {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} * -1}} {{#if: {{{highlight|}}} | '''days''' | days }}}}</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 02:14, 14 January 2009

Template documentation[view] [edit] [history] [purge]

Usage

This template will return a number in days if the date given is less than 60 days away; otherwise, it will return a number in months, so that it does not return large numbers of days that are probably not very useful, which can sometimes be in the thousands.

{{days from now|2020|1|1}}

produces

-2075 days

See also