Template:Start date text/doc

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search
BadSalzdetfurthBadenburgerStr060529.jpg

{{Start-date}} and {{End-date}} are easy to read "plain text" date and time templates that emit microformat dates for events. These templates are an alternative to the {{Start date}} and {{End date}} templates that also emit microformats but require dates to be expressed in standard, unambiguous and international ISO syntax. "Fuzzy" dates and times are supported. For events where the precise time, day or month is not known, the user may omit these details. Time zones are assumed to be local to the event. If time zone information is specified, the otherwise optional timezone parameter must be set.

Examples

Examples of {{Start-date}} and {{End-date}} (colors for emphasis only)
Samples below display December 7, 1941 (1941-12-07), and emit hidden microformat date: 1941-12-07
{{start-date|December 7, 1941}} → December 7, 1941 (1941-12-07)
{{end-date|December 7, 1941}}   → December 7, 1941 (1941-12-08)
Samples below display 7 December 1941 (1941-12-07), and emit hidden microformat date: 1941-12-07
{{start-date|7 December 1941}} → 7 December 1941 (1941-12-07)
{{end-date|7 December 1941}}   → 7 December 1941 (1941-12-08)

Microformat output

Start date templates:

  • {{Start-date|31 December 2016}} → 31 December 2016 (2016-12-31)
    31 December 2016<span style="display:none">&#160;(<span class="dtstart ">2016-12-31</span>)</span>
  • {{Start date|2016|12|31|df=y}} → 31 December 2016 (2016-12-31)
    31&nbsp;December&nbsp;2016<span style="display:none">&#160;(<span class="bday dtstart published updated">2016-12-31</span>)</span>

End date templates:

  • {{End-date|31 December 2016}} → 31 December 2016 (2017-01-01)
    31 December 2016<span style="display:none">&#160;(<span class="dtend ">2017-01-01</span>)</span>
  • {{End date|2016|12|31|df=y}} → 31 December 2016 (2016-12-31)
    31&nbsp;December&nbsp;2016<span style="display:none">&#160;(<span class="dtend">2016-12-31</span>)</span>

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Start date text in articles based on its TemplateData.

TemplateData for Start date text

<templatedata> { "params": { "1": {}, "2": {}, "ISO8601": {}, "dt": {}, "display": {}, "timezone": {}, "tz": { "description": "set to \"yes\" when timezone is present, or when timzone UTC is implicit", "type": "boolean" }, "BCE": {}, "BC": {}, "class-extra": {}, "df": {} }, "paramOrder": [ "1", "2", "ISO8601", "dt", "tz", "timezone", "BCE", "BC", "display", "class-extra", "df" ] } </templatedata>

Ambiguous times and dates

For the years 99 BC to 99AD especially, microformats may not be emitted properly unless expressed in the form YYYY-MM-DD. For users uninterested in microformats, it should be noted that this restriction has no known impacts other than microformat data which are currently invisible to users. The user of course may express the display form in the second parameter however they would like. Example: 1-2-3 is interpreted as February 3, 1 A.D, and emitted in that form via microformats when the user may have intended something else. Other 3 digit years may be misinterpreted as well, so best practice is to use leading zeros to make a 4 digit year for this date range. For example, February 274 will be interpreted as February 27, 2004. Instead, use "February 0274". Background: There is a good rationale for the behavior of the system function which actually does the hard work of this template. It is very unusual for people to mention such dates so long ago, so when we really mean this date, we must specify a 4 digit date. Outside of this period with ambiguous years, users may use free text dates without this restriction. Bot runs may make a conversion of non 4 digit years to 4 digits (with leading zeros) in order to refine Wikipedia's quality of microformat dates. These changes will not affect display, but for those curious, this is the rationale for such bot manipulations.

Tracking categories

Template transclusions with invalid parameters:

See also