Template:Date/doc: Difference between revisions
More actions
mNo edit summary |
update |
||
| Line 16: | Line 16: | ||
*"form=ins" for [[:en:Instrumental case|instrumental case]] (supported for pl, cs & sl languages) | *"form=ins" for [[:en:Instrumental case|instrumental case]] (supported for pl, cs & sl languages) | ||
Also [[:en:Partitive case|Partitive]] (ptv), [[:en:Inessive case|Inessive]] (ine), [[:en:Elative case|Elative]] (ela) and [[:en:Illative case|Illative]] (ill) cases are supported for Finnish language, in addition to [[:en:Nominative case|Nominative]] and [[:en:Genitive case|Genitive]] (gen). | Also [[:en:Partitive case|Partitive]] (ptv), [[:en:Inessive case|Inessive]] (ine), [[:en:Elative case|Elative]] (ela) and [[:en:Illative case|Illative]] (ill) cases are supported for Finnish language, in addition to [[:en:Nominative case|Nominative]] and [[:en:Genitive case|Genitive]] (gen). | ||
|6=class | |||
|6d=allows to set the html class of the time node where the time is included. This is useful for microformats. The default value is, for legacy reasons, "dtstart" (used by [[w:HCalendar|hCalendar]]). See [[Commons:Microformats Project|the microformats project]]. | |||
|6def=dtstart | |||
|name=Date | |name=Date | ||
|desc=This template is used to show a date in the language set in the preferences. | |desc=This template is used to show a date in the language set in the preferences. | ||
| Line 38: | Line 41: | ||
=== Microformat === | === Microformat === | ||
The template | The template returns the date, embed in a <nowiki><time></nowiki> element with attribute datetime that contain the date in the ISO 8601 format needed by the <!-- hAtom (class="updated"),--> [[w:HCalendar|hCalendar]] (<code>class="dtstart"</code>) <!-- and hCard (class="bday")--> microformat. See [[Commons:Microformats Project|the microformats project]]. | ||
|type=marker | |type=marker | ||
|example= | |example= | ||
Revision as of 19:55, 26 December 2012
This template is used to show a date in the language set in the preferences.
You can leave out parts of the data.
Usage
{{Date |1= |2= |3= |4= |form= |class= }}
Examples:
{{date|2009|1|9}}→ 9 January 2009{{date|2009|1|9|pl}}→ 9 stycznia 2009{{date|2009|1|9|pl|form=}}→ 9 stycznia 2009 - alternative way to get nominative case{{date|2009|1|9|pl|form=gen}}→ 9 stycznia 2009{{date|2009|1|9|pl|form=ins}}→ 9 stycznia 2009{{date|2009|1|pl}}→ styczeń 2009{{date|2009|1|pl|form=gen}}→ styczeń 2009{{date|2009|1|pl|form=ins}}→ styczeń 2009
Does not check existence, except for the month number:
{{date|2009|12|33}}→ December 2009{{date|2009|17|33}}→ 2009
Microformat
The template returns the date, embed in a <time> element with attribute datetime that contain the date in the ISO 8601 format needed by the hCalendar (class="dtstart") microformat. See the microformats project.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | number of the year | empty | optional | |
2 | number of month in the year | empty | optional | |
3 | number of day in the month | empty | optional | |
4 | language code (overrides user's preferences) | language code of the user language | optional | |
form | allows to specify grammatical case for the month in YYYY-MM dates, for languages that use them. Possible cases:
| empty | optional | |
class | allows to set the html class of the time node where the time is included. This is useful for microformats. The default value is, for legacy reasons, "dtstart" (used by hCalendar). See the microformats project. | dtstart | optional | |
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: all users
Relies on:
{{I18n month}}, {{Formatnum}}
See also
{{ISOdate}} – Template used to parse the date in {{Information}}<br\> {{Other date}} - Allows to specify a range of non-trivial date notations in a format that is localizable
Localization
To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{LangSwitch|}}" construct. It takes the form "|xx= Your translation " (xx being the code of your language)