Template:Da/doc
Documentation
This template generates an anchor↗ (i.e., a target for incoming links) named for the specified date, and formats the date visually according to readers' preferences. If no date is specified, it uses the current date (which is almost certainly not what you want, since the link target would change each day). If it is used on the "Timeline" page, the date will be stored in the "Dates" Cargo table.
The name of this template is based on the phrase "date anchor".
Usage
{{da|YYYY-MM-DD}}{{da|YYYY-MM-DD|no-format=y}}{{da|YYYY-MM-DD|text}}
The second form is for cases where you don't want the date to be formatted, for whatever reason. The value y can actually be any true value.
The third form is for special cases where the anchor should be placed on text that does not match the anchor itself (see third example below). If this form is used, the template doesn't try to format text as a date (which is usually what you want).
Examples
{{da}}⇒ 2026-01-25{{da|2020-11-06}}⇒ 2020-11-06{{da|2020-11-06|no-format=y}}⇒ 2020-11-06{{da|2015-12-04}}–{{da|2015-12-05|05}}⇒ 2015-12-04–05
Most browsers will not render anchors in any special way visually (some text-only browsers do, but most graphical browers don't, for whatever reason). However, you might see a "tooltip" if you "hover" on the dates in the examples above. This is caused by the id attribute of the <span> tag generated by the template.
Unless you have specified otherwise under "Date format" in the "Appearances" tab of your own preferences, you will see all of these examples rendered in the same "ISO date format" as the input shown in, say, the second example template call.
Here are all the formats that users can choose:
- 2020-11-06
- November 6, 2020
- 6 November 2020
- 2020 November 6
These examples create targets for incoming links to this page. If another page on the wiki contained the link [[Template:Da/doc#2020-11-06]], then following that link would land you at the position on this page where "2020-11-06" appears above. (Usually this means that text would be at the very top of the browser window [or "viewport"… whatever]. In this case, though, since the text is so far down the page, it probably would not appear at the top of the browser window. This, of course, depends on your browser window size and font settings.)
The third example creates two anchors, the second of which, on the text "05", would be the target of a link to [[Template:Da/doc#2015-12-05]].
See also
{{a}}– creates an anchor (not just for dates){{d}}– links and formats a date{{du}}– formats a date but doesn't link it