This is a documentation subpage for Template:Infobox date field metadata. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template allows infoboxes to automatically produce invisible machine-readable metadata in form of microformats (see also WP Microformats) from infobox fields using recognized dates, times, and date ranges for all articles using that infobox. This is equivallent to using {{start date}} and similar templates in the articles directly. Unrecognized, ambiguous and incomplete values are skipped and some will produce an error tracking category.
The use of this template allows well-formatted date fields to output metadata without the need for {{start date}} and {{end date}} template family when the field value is a simple date (planned: or some common recognized cases, such as attached references).
This template does not fully replace {{start date}} and these templates will be required if the field value cannot be easily recognized, such as containing additional text or multiple dates. In such cases, the module will not output anything.
Usage
- Note that the module is in development and most planned options are missing, including a wider range of metadata services
This template is not meant to be used directly in any article, only in infoboxes. Place {{Infobox date field metadata|{{{field|}}}}}
in your event infobox's date field. Note that the infobox itself has to have the appropriate metadata classes, such as vevent
.
{{ infobox
| bodyclass = vevent
...
| label1 = Location
| data1 = {{{location|}}}
| label2 = Date(s)
| data2 = {{Infobox date field metadata|{{{date|}}}}}{{{date|}}}
| label3 = Participants
| data3 = {{{participants|}}}
...
}}
|dtstart=yes
specifies that hCalendar (WP:UF#hCalendar)dtstart
(event start date) class is to be output if possible (default: yes)|dtend=yes
specifies that hCalendardtend
(event end date) class is to be output if possible (default: yes)|trackingCat=yes
specifies that Category:Articles with automatically detected infobox date metadata should be added to every article where metadata was successfully emitted
Example usage
In short, the following (MOS:DATE recommended) common date/time examples are recognized when used in articles:
|date=3 May 2013
|date=May 3, 2013
|date=3 May 2013, 22:17:06
|date=22:17:06, 3 May 2013
|date=10:17 p.m., 3 May 2013
|date=May 3, 2013 – February 7, 2014
|date=3–7 May 2013
|date=2013–2014
The module also makes moderate attempts at recognizing common variations and misformatting. See module's testcase results for a comprehensive list of what values are recognized and parsed.
Sample results
3 May 2013
would produce:
<span style="display:none"> (<span class="dtstart">2013-05-03</span>)</span>
2013
would produce:
<span style="display:none"> (<span class="dtstart">2013</span>)</span>
May 3, 2013 – February 12, 2014
would produce:
<span style="display:none"> (<span class="dtstart">2013-05-03</span><span class="dtend">2014-02-12</span>)</span>
May 2013 – February 2014
would produce:
<span style="display:none"> (<span class="dtstart">2013-05</span><span class="dtend">2014-02</span>)</span>