Template:Date/doc: Difference between revisions
More actions
No edit summary |
|||
| Line 1: | Line 1: | ||
{{TemplateBox | |||
|1=1 | |||
|1d=number of the year | |||
|2=2 | |||
|2d=number of month in the year | |||
|3=3 | |||
|3d=number of day in the month | |||
|4=4 | |||
|4d=language code (only needs to be provided if the shall be fixed and independent of the user's preferences) | |||
|4def=language code of the user language | |||
|5=form | |||
|5d=allows to specify [[:en:Grammatical case|grammatical case]] for the month in YYYY-MM dates, for languages that use them. Possible cases: | |||
*leave blank for [[:en:Nominative case|nominative case]] | |||
*"form=gen" for [[:en:Genitive case|genitive case]] | |||
*"form=loc" for [[:en:Locative case|locative 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). | |||
|name=Date | |||
|desc=This template is used to show a date in the language set in the preferences. | |||
You can leave out parts of the data. | |||
|namespace=Template | |||
|usergroup=all | |||
|usage-notes= | |||
Examples: | |||
*{{xpdoc|date|2009|1|9}} | |||
*{{xpdoc|date|2009|1|9|pl}} | |||
*{{xpdoc|date|2009|1|9|pl|n1=form|v1=gen}} | |||
*{{xpdoc|date|2009|1|9|pl|n1=form|v1=ins}} | |||
*{{xpdoc|date|2009|1||pl}} | |||
*{{xpdoc|date|2009|1||pl|n1=form|v1=gen}} | |||
*{{xpdoc|date|2009|1||pl|n1=form|v1=ins}} | |||
Does not check existence, except for the month number: | |||
*{{xpdoc|date|2009|12|33}} | |||
*{{xpdoc|date|2009|17|33}} | |||
=== Microformat === | |||
The template also returns the date, hidden by CSS, 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 | |||
|example= | |||
|i18n-method=switch | |||
|i18n-desc= | |||
|seealso={{tl|ISOdate}} – Template used to parse the date in {{tl|information}}; {{tl|other date}} | |||
|setscats= | |||
|lines=one | |||
|shorthand= | |||
|relieson={{tl|I18n month}}, {{tl|formatnum}} | |||
}} | |||
<includeonly> | |||
[[Category:Time, date and calendar templates|{{PAGENAME}}]] | |||
[[Category:User interface language dependent templates|{{PAGENAME}}]] | |||
</includeonly> | |||
| | |||
Revision as of 08:50, 25 October 2011
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= }}
Examples:
{{date|2009|1|9}}→ 9 January 2009{{date|2009|1|9|pl}}→ 9 stycznia 2009{{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 also returns the date, hidden by CSS, 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 (only needs to be provided if the shall be fixed and independent of the 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 | |
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}}; {{Other date}}
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)
|