Difference between revisions of "Template:Adt"

From blackwiki
Jump to navigation Jump to search
m (21 revisions imported)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>{{tfd|Adt}}
+
access-date={{#switch:{{{1}}}
</noinclude>accessdate={{<includeonly>subst:</includeonly>CURRENTYEAR}}-<!--
+
|mdy={{<includeonly>subst:</includeonly>CURRENTMONTHNAME}} {{<includeonly>subst:</includeonly>CURRENTDAY}}, {{<includeonly>subst:</includeonly>CURRENTYEAR}}
-->{{<includeonly>subst:</includeonly>CURRENTMONTH}}-<!--
+
|iso={{<includeonly>subst:</includeonly>CURRENTYEAR}}-{{<includeonly>subst:</includeonly>CURRENTMONTH}}-{{<includeonly>subst:</includeonly>CURRENTDAY2}}
-->{{<includeonly>subst:</includeonly>CURRENTDAY2}}<noinclude>
+
|dmy
{{documentation|content=
+
|{{<includeonly>subst:</includeonly>CURRENTDAY}} {{<includeonly>subst:</includeonly>CURRENTMONTHNAME}} {{<includeonly>subst:</includeonly>CURRENTYEAR}}
{{subst only}}
+
}}<noinclude>
: '''Adt''' is designed to be used with most {{C|Citation templates}} by providing the proper syntax and fieldname for the standardized field 'accessdate' '''needed when citing an URL''' in most of those templates.
+
{{documentation}}</noinclude>
===Usage===
 
This template MUST be subst'd.
 
 
 
When subst'd, the template provides the ISO date field and word string
 
:"accessdate=CURRENTYEAR-CURRENTMONTH-CURRENTDAY" (all numeric with proper leading zero's)
 
Alternatively, it can be used to record an older date:
 
:"accessdate={{{3}}}-{{{2}}}-{{{1}}}", of which any one, two, or all three may be specified, and again will add proper leading zero's and format the output.
 
 
 
===Examples===
 
# '''<nowiki>|{{subst:Adt|</nowiki>''three days ago''}}''' &mdash; generates the string with the date of three days ago.{{indent}}Given: '''|<nowiki>{{subst:</nowiki>Adt|5}}''' it will generate:
 
#:<code> '''<nowiki>|accessdate=</nowiki>{{CURRENTYEAR}}-{{CURRENTMONTH}}-05'''</code>
 
#'''<nowiki>|{{subst:Adt|</nowiki>''three days ago''|''lastmonth''}}''' &mdash; generates the string with the date of three days ago, which was in the different '''last month'''.{{indent}}Given: '''|<nowiki>{{subst:</nowiki>Adt|3|10}}''' it will generate:
 
#:'''<code><nowiki>|accessdate=</nowiki>{{CURRENTYEAR}}-10-03</code>'''
 
#''"Last year"''&mdash;has been left as an exercise for the pupil!
 
 
 
}}
 
 
 
[[Category:Citation templates|{{PAGENAME}}]]
 
 
 
</noinclude>
 

Latest revision as of 10:18, 18 October 2020

access-date=8 April 2026

Template documentation[view] [edit] [history] [purge]

Adt creates the access-date parameter and value for most Citation templates.

Access (retrieved) dates may be implemented in three formats and should be consistent throughout the article:

Format Example Notes
D Month YYYY: 3 April 2026 "DMY" – day followed by full month name, followed by year; no leading zeros
Month D, YYYY: April 3, 2026 "MDY" – full month name then day; comma separating the day and year; no leading zeros
YYYY-MM-DD: 2026-04-03 "ISO" – all numeric, with 2-digit day and month

Usage

This template must be subst'd.

When subst'd, the template provides the access-date parameter name, the = sign, and the formatted date. You may specify a date format to be consistent with the other citations in the article:

Markup Generates Renders as
|{{subst:adt}} |access-date={{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} |access-date=8 April 2026
(default; the most common internationally)
|{{subst:adt|dmy}} |access-date={{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} |access-date=8 April 2026
(same as default)
|{{subst:adt|mdy}} |access-date={{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}} |access-date=April 8, 2026
(chiefly US)
|{{subst:adt|iso}} |access-date={{CURRENTYEAR}}-{{CURRENTMONTH2}}-{{CURRENTDAY2}} |access-date=2026-04-08
(ISO 8601; chiefly technical)

Note that the template does not include the leading pipe (|); always precede {{subst:adt}} with a pipe character as in the examples above.