Template:Date/doc: Difference between revisions
More actions
No edit summary |
No edit summary |
||
| Line 56: | Line 56: | ||
|15=case | |15=case | ||
|15alias= form | |15alias=form | ||
|15d-en=allows to specify [[:en:Grammatical case|grammatical case]] for the month for languages that use them. Possible cases: | |15d-en=allows to specify [[:en:Grammatical case|grammatical case]] for the month for languages that use them. Possible cases: | ||
*leave blank for default case, which is usually [[:en:Nominative case|nominative]] or [[:en:Genitive case|genitive case]] | *leave blank for default case, which is usually [[:en:Nominative case|nominative]] or [[:en:Genitive case|genitive case]] | ||
| Line 96: | Line 96: | ||
*{{xpdoc|date|2009|1|9}} | *{{xpdoc|date|2009|1|9}} | ||
*{{xpdoc|date|2009|1|9|pl}} | *{{xpdoc|date|2009|1|9|pl}} | ||
*{{xpdoc|date|2009|1|9|pl|n1= | *{{xpdoc|date|2009|1|9|pl|n1=case|v1=}} - alternative way to get nominative case | ||
*{{xpdoc|date|2009|1|9|pl|n1= | *{{xpdoc|date|2009|1|9|pl|n1=case|v1=gen}} | ||
*{{xpdoc|date|2009|1|9|pl|n1= | *{{xpdoc|date|2009|1|9|pl|n1=case|v1=ins}} | ||
*{{xpdoc|date|2009|1||pl}} | *{{xpdoc|date|2009|1||pl}} | ||
*{{xpdoc|date|2009|1||pl|n1=form|v1=gen}} | *{{xpdoc|date|2009|1||pl|n1=form|v1=gen}} | ||
*{{xpdoc|date|2009|1||pl|n1=form|v1=ins}} | *{{xpdoc|date|2009|1||pl|n1=form|v1=ins}} | ||
*{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3= | *{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3=case|v3=ins|n4=trim_year|v4=yes}} | ||
*{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3= | *{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3=case|v3=ins|n4=trim_year|v4=no}} | ||
*{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3= | *{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3=case|v3=ins|n4=trim_year|v4=100-999}} | ||
*{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3= | *{{xpdoc|date|n1=year|v1=888|n2=lang|v2=pl|n3=case|v3=ins|n4=trim_year|v4=100-500}} | ||
=== Microformat === | === Microformat === | ||
Revision as of 13:07, 9 January 2015
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= }}
Examples:
{{date|2009|1|9}}→ 9 January 2009{{date|2009|1|9|pl}}→ 9 stycznia 2009{{date|2009|1|9|pl|case=}}→ 9 stycznia 2009 - alternative way to get nominative case{{date|2009|1|9|pl|case=gen}}→ 9 stycznia 2009{{date|2009|1|9|pl|case=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{{date|year=888|lang=pl|case=ins|trim_year=yes}}→{{date|year=888|lang=pl|case=ins|trim_year=no}}→{{date|year=888|lang=pl|case=ins|trim_year=100-999}}→{{date|year=888|lang=pl|case=ins|trim_year=100-500}}→
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 |
trim_yeartrim year | trim year | Should years smaller than 1000 be padded with zeros to the length of 4 digits or trimmed. Options:
| 100-999 | 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 ==
Localize the date format at Module:I18n/date or request assistance at Template talk:Date or Module talk:I18n/date