Difference between revisions of "Template:Date range"
Jump to navigation
Jump to search
imported>Jay D. Easy (this ought to take care of the stray comma with df=y) |
imported>Jay D. Easy (actually, I wrecked more than I fixed) |
||
Line 1: | Line 1: | ||
− | <includeonly><span style="display:none"> (<span class="dtstart">{{{1|{{{year}}}}}}-{{padleft:{{{2|{{{month}}}}}}|2|0}}-{{padleft:{{{3|{{{day}}}}}}|2|0}}</span>)</span><span style="display:none"> (<span class="dtend">{{{4|{{{year}}}}}}-{{padleft:{{{5|{{{month}}}}}}|2|0}}-{{padleft:{{{6|{{{day}}}}}}|2|0}}</span>)</span>{{nowrap|{{#if:{{{df| }}}|{{#expr:{{{3|{{{day1| }}}}}}}} {{MONTHNAME|{{{2|{{{month1}}} }}}}}|{{MONTHNAME|{{{2|{{{month1}}} }}}}} {{#expr:{{{3|{{{day1| }}}}}}}}}}{{#ifeq:{{{1|{{{year1}}} }}}|{{{4|{{{year2}}} }}}|| | + | <includeonly><span style="display:none"> (<span class="dtstart">{{{1|{{{year}}}}}}-{{padleft:{{{2|{{{month}}}}}}|2|0}}-{{padleft:{{{3|{{{day}}}}}}|2|0}}</span>)</span><span style="display:none"> (<span class="dtend">{{{4|{{{year}}}}}}-{{padleft:{{{5|{{{month}}}}}}|2|0}}-{{padleft:{{{6|{{{day}}}}}}|2|0}}</span>)</span>{{nowrap|{{#if:{{{df| }}}|{{#expr:{{{3|{{{day1| }}}}}}}} {{MONTHNAME|{{{2|{{{month1}}} }}}}}|{{MONTHNAME|{{{2|{{{month1}}} }}}}} {{#expr:{{{3|{{{day1| }}}}}}}}}}{{#ifeq:{{{1|{{{year1}}} }}}|{{{4|{{{year2}}} }}}||, {{{1|{{{year1}}} }}}}} – {{#if:{{{df| {{{dayfirst|}}} }}}|{{#expr:{{{6|{{{day2| }}} }}}}} {{MONTHNAME|{{{5|{{{month2}}} }}}}}|{{MONTHNAME|{{{5|{{{month2}}} }}}}} {{#expr:{{{6|{{{day2| }}} }}}}},}} {{{4|{{{year2}}} }}}}}</includeonly><noinclude> |
+ | {{documentation}}</noinclude> |
Latest revision as of 21:38, 13 August 2019
To use
{{Date range|Year of event start|Month of event start|Day of event start|Year of event end|Month of event end|Day of event end}}
For example:
{{Date range|1996|April|20|2002|June|9}}
yields
April 20, 1996 – June 9, 2002
and
{{Date range|1996|April|20|2002|June|9}}
yields
20 April, 1996 – 9 June 2002
Days are optional, allowing
{{Date range|year1=1996|month1=Apr|year2=2002|month2=Jun}}
to yield
April, 1996 – June , 2002 .
Template Data
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
TemplateData for Date range
Represents a range of dates.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Start year | 1 year1 | Year the event started
| Number | required |
Start month | 2 month1 | Month the event started
| String | required |
Start day | 3 day1 | Day the event started
| String | suggested |
End year | 4 year2 | Year the event ended
| Number | required |
End month | 5 month2 | Month the event ended
| String | required |
End day | 6 day2 | Day of month the event ended
| String | suggested |
Day first? | df dayfirst | if 'y' or 'yes', day comes before month | String | optional |
See also
{{Date range and age}}
{{Date range and age in years, months, weeks and days}}
{{Age in years, months, weeks and days}}
- Wikipedia:Age calculation templates
The above documentation is transcluded from Template:Date range/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |