Difference between revisions of "Template:Date range and age/sandbox"
Jump to navigation
Jump to search
imported>TheBigJagielka |
imported>TheBigJagielka |
||
Line 1: | Line 1: | ||
− | {{#if:{{{df| | + | <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> {{#if:{{{df|}}}{{#ifeq: {{{1}}} | {{{4}}} |
| {{#ifeq: {{MONTHNAME|{{{2}}}}} | {{MONTHNAME|{{{5}}}}} | | {{#ifeq: {{MONTHNAME|{{{2}}}}} | {{MONTHNAME|{{{5}}}}} | ||
− | | {{{3}}} - {{{6}}} {{MONTHNAME|{{{5}}}}} {{{4}}} | + | | {{#expr:{{{3}}}}} - {{#expr:{{{6}}}}} {{MONTHNAME|{{{5}}}}} {{{4}}} |
− | |{{{3}}} {{MONTHNAME|{{{2}}}}} - {{{6}}} {{MONTHNAME|{{{5}}}}} {{{4}}}}} | + | | {{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} - {{#expr:{{{6}}}}} {{MONTHNAME|{{{5}}}}} {{{4}}}}} |
− | | {{{3}}} {{MONTHNAME|{{{2}}}}} {{{1}}} - {{{6}}} {{MONTHNAME|{{{5}}}}} {{{4}}}}} | + | | {{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} {{{1}}} - {{#expr:{{{6}}}}} {{MONTHNAME|{{{5}}}}} {{{4}}}}} |
| {{#ifeq: {{{1}}} | {{{4}}} | | {{#ifeq: {{{1}}} | {{{4}}} | ||
| {{#ifeq: {{MONTHNAME|{{{2}}}}} | {{MONTHNAME|{{{5}}}}} | | {{#ifeq: {{MONTHNAME|{{{2}}}}} | {{MONTHNAME|{{{5}}}}} | ||
− | | {{MONTHNAME|{{{5}}}}} {{{3}}} - {{{6}}}, {{{4}}} | + | | {{MONTHNAME|{{{5}}}}} {{#expr:{{{3}}}}} - {{#expr:{{{6}}}}}, {{{4}}} |
− | | {{MONTHNAME|{{{2}}}}} {{{3}}} - {{MONTHNAME|{{{5}}}}} {{{6}}}, {{{4}}}}} | + | | {{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}} - {{MONTHNAME|{{{5}}}}} {{#expr:{{{6}}}}}, {{{4}}}}} |
− | | {{MONTHNAME|{{{2}}}}} {{{3}}}, {{{1}}} - {{MONTHNAME|{{{5}}}}} {{{6}}}, {{{4}}}}}}}}} | + | | {{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}}, {{{1}}} - {{MONTHNAME|{{{5}}}}} {{#expr:{{{6}}}}}, {{{4}}}}}}} |
+ | }}</br><small>({{#expr: | ||
+ | + {{Gregorian serial date | ||
+ | |month = {{{month2|{{{5|{{CURRENTMONTH}}}}}}}} | ||
+ | |day = {{{day2|{{{6|{{CURRENTDAY}}}}}}}} | ||
+ | |year = {{{year2|{{{4|{{CURRENTYEAR}}}}}}}} | ||
+ | }} | ||
+ | - {{Gregorian serial date | ||
+ | |month = {{{month1|{{{2|{{CURRENTMONTH}}}}}}}} | ||
+ | |day = {{{day1|{{{3|{{CURRENTDAY}}}}}}}} | ||
+ | |year = {{{year1|{{{1|{{CURRENTYEAR}}}}}}}} | ||
+ | }} }} days)</small></includeonly> | ||
* Year - {{{1}}} | * Year - {{{1}}} | ||
* Month - {{MONTHNAME|{{{2}}}}} | * Month - {{MONTHNAME|{{{2}}}}} | ||
Line 16: | Line 27: | ||
* Month - {{MONTHNAME|{{{5}}}}} | * Month - {{MONTHNAME|{{{5}}}}} | ||
* Day - {{{6}}} | * Day - {{{6}}} | ||
+ | |||
+ | |||
+ | <noinclude>{{documentation}}</noinclude> |
Revision as of 21:27, 22 April 2012
- Year - {{{1}}}
- Month -
- Day - {{{3}}}
- Year - {{{4}}}
- Month -
- Day - {{{6}}}
![]() | This is the template sandbox page for Template:Date range and age (diff). |
To use
{{Date range and age|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 and age|1996|April|20|2002|June|9}}
yields
20 April, 1996 – 9 June 2002
(2241 days)
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 and age
Represents a range of dates, and calculates the number of elapsed days in between
Parameter | Description | Type | Status | |
---|---|---|---|---|
Start year | 1 year1 | Year the event started
| Number | suggested |
Start month | 2 month1 | Month the event started
| String | suggested |
Start day | 3 day1 | Day the event started
| String | suggested |
End year | 4 year2 | Year the event ended
| Number | suggested |
End month | 5 month2 | Month the event ended
| String | suggested |
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}}
{{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 and age/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |