Template:Date/doc: Difference between revisions
More actions
No edit summary |
mNo edit summary |
||
| Line 3: | Line 3: | ||
|1 = year | |1 = year | ||
|1aliases= 1 | |1aliases= 1 | ||
|1d-en = number | |1d-en = Year number | ||
|1label = year | |1label = year | ||
|1d-td = year | |1d-td = year | ||
| Line 11: | Line 11: | ||
|2 = month | |2 = month | ||
|2aliases= 2 | |2aliases= 2 | ||
|2d-en = number | |2d-en = Month number or name (in English) | ||
|2label = month | |2label = month | ||
|2d-td = month | |2d-td = month | ||
| Line 19: | Line 19: | ||
|3 = day | |3 = day | ||
|3aliases= 3 | |3aliases= 3 | ||
|3d-en = number | |3d-en = Day number | ||
|3label = day | |3label = day | ||
|3d-td = day | |3d-td = day | ||
| Line 26: | Line 26: | ||
|4 = hour | |4 = hour | ||
|4d-en = | |4d-en = Hour number in 0-23 range | ||
|4label = hour | |4label = hour | ||
|4d-td = hour | |4d-td = hour | ||
| Line 33: | Line 33: | ||
|5 = minute | |5 = minute | ||
|5d-en = | |5d-en = Minutes number in 0-59 range | ||
|5label = minute | |5label = minute | ||
|5d-td = minute | |5d-td = minute | ||
| Line 40: | Line 40: | ||
|6 = second | |6 = second | ||
|6d-en = | |6d-en = Seconds number in 0-59 range | ||
|6label = second | |6label = second | ||
|6d-td = second | |6d-td = second | ||
| Line 48: | Line 48: | ||
|14 = lang | |14 = lang | ||
|14aliases= 4 | |14aliases= 4 | ||
|14d-en = | |14d-en = Language code (overrides user's preferences) | ||
|14label = language | |14label = language | ||
|14d-td = language | |14d-td = language | ||
| Line 57: | Line 57: | ||
|15=case | |15=case | ||
|15alias= form | |15alias= form | ||
|15d-en=allows to specify [[:en:Grammatical case|grammatical case]] for the month | |15d-en=allows to specify [[:en:Grammatical case|grammatical case]] for the month for languages that use them. Possible cases: | ||
*leave blank for [[:en:Nominative case|nominative case]] | *leave blank for [[:en:Nominative case|nominative case]] | ||
*"case=gen" for [[:en:Genitive case|genitive case]] | *"case=gen" for [[:en:Genitive case|genitive case]] | ||
Revision as of 16:52, 20 June 2014
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 |year= |month= |day= |hour= |minute= |second= |lang= }}
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 | |
|---|---|---|---|---|
year1 | year | Year number | empty | optional |
month2 | month | Month number or name (in English) | empty | optional |
day3 | day | Day number | empty | optional |
hour | hour | Hour number in 0-23 range | empty | optional |
minute | minute | Minutes number in 0-59 range | empty | optional |
second | second | Seconds number in 0-59 range | empty | optional |
lang4 | language | Language code (overrides user's preferences) | language code of the user language | optional |
case | case | allows to specify grammatical case for the month for languages that use them. Possible cases:
| empty | optional |
class | class | allows to set the html class of the time node where the date is included. This is useful for microformats. The default value is, for legacy reasons, "dtstart" (used by hCalendar). See the microformats project. "class=" will remove all metadata. | 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:
Module:Date
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 ==