Difference between revisions of "Template:Date range and age/doc"

From blackwiki
Jump to navigation Jump to search
imported>Meteor sandwich yum
m (→‎To use: tyop)
imported>Daviddwd
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{documentation subpage}}
 
==== To use ====
 
==== To use ====
:<nowiki>{{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|df=y}}</nowiki>
+
 
 +
:{{Tlx|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|df=y}}
 +
 
 +
For example:
 +
 
 +
{{Tlx|Date range and age|1996|April|20|2002|June|9|df=y}}
 +
 
 +
yields
 +
 
 +
{{Date range and age|1996|April|20|2002|June|9|df=y}}
 +
 
 +
== Template Data ==
 +
{{TemplateDataHeader}}
 +
 
 +
<templatedata>
 +
{
 +
"params": {
 +
"1": {
 +
"aliases": [
 +
"year1"
 +
],
 +
"label": "Start year",
 +
"type": "number",
 +
"suggested": true,
 +
"description": "Year the event started",
 +
"example": "1920"
 +
},
 +
"2": {
 +
"aliases": [
 +
"month1"
 +
],
 +
"label": "Start month",
 +
"type": "string",
 +
"suggested": true,
 +
"description": "Month the event started",
 +
"example": "June"
 +
},
 +
"3": {
 +
"aliases": [
 +
"day1"
 +
],
 +
"label": "Start day",
 +
"type": "string",
 +
"suggested": true,
 +
"description": "Day the event started",
 +
"example": "9"
 +
},
 +
"4": {
 +
"aliases": [
 +
"year2"
 +
],
 +
"label": "End year",
 +
"type": "number",
 +
"suggested": true,
 +
"description": "Year the event ended",
 +
"example": "1969"
 +
},
 +
"5": {
 +
"aliases": [
 +
"month2"
 +
],
 +
"label": "End month",
 +
"type": "string",
 +
"description": "Month the event ended",
 +
"example": "April",
 +
"suggested": true
 +
},
 +
"6": {
 +
"aliases": [
 +
"day2"
 +
],
 +
"label": "End day",
 +
"type": "string",
 +
"description": "Day of month the event ended",
 +
"example": "20",
 +
"suggested": true
 +
},
 +
"df": {
 +
"label": "Day first?",
 +
"description": "if 'y' or 'yes', day comes before month",
 +
"type": "string",
 +
"aliases": [
 +
"dayfirst"
 +
]
 +
}
 +
},
 +
"description": "Represents a range of dates, and calculates the number of elapsed days in between"
 +
}
 +
</templatedata>
 +
 
 +
== See also ==
 +
*{{tlx|Date range}}
 +
*{{tlx|Date range and age in years, months, weeks and days}}
 +
*{{tlx|Age in years, months, weeks and days}}
 +
*[[Wikipedia:Age calculation templates]]

Latest revision as of 00:23, 7 December 2018

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

(1996-April-20) (2002-June-09)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

Template parameters

ParameterDescriptionTypeStatus
Start year1 year1

Year the event started

Example
1920
Numbersuggested
Start month2 month1

Month the event started

Example
June
Stringsuggested
Start day3 day1

Day the event started

Example
9
Stringsuggested
End year4 year2

Year the event ended

Example
1969
Numbersuggested
End month5 month2

Month the event ended

Example
April
Stringsuggested
End day6 day2

Day of month the event ended

Example
20
Stringsuggested
Day first?df dayfirst

if 'y' or 'yes', day comes before month

Stringoptional

See also