Template:ISOdate/doc: Difference between revisions
Template page
More actions
mNo edit summary |
Prefix language interwiki links with w: |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Lua|Module:ISOdate}} | |||
{{TemplateBox | {{TemplateBox | ||
|1=1 | |1=1 | ||
| Line 20: | Line 21: | ||
|5=case | |5=case | ||
|5alias= form | |5alias= form | ||
|5d-en=allows to specify [[: | |5d-en=allows to specify [[:w:Grammatical case|grammatical case]] for the month for languages that use them. Possible cases: | ||
* leave blank for default case, which is usually [[: | * leave blank for default case, which is usually [[:w:Nominative case|nominative]] in most languages or [[:w:Genitive case|genitive case]], for a date given in isolation (out of a sentence). | ||
* "case=nom" for the [[: | * "case=nom" for the [[:w:Nominative case|nominative case]] (for many languages with distinctive grammatical cases, for languages without case distinctions, this is the only existing form) | ||
* "case=gen" for the [[: | * "case=gen" for the [[:w:Genitive case|genitive case]] (supported for languages with distinctive grammatical cases) | ||
* "case=loc" for the [[: | * "case=loc" for the [[:w:Locative case|locative case]] (supported for languages: pl, cs, sl) | ||
* "case=ins" for the [[: | * "case=ins" for the [[:w:Instrumental case|instrumental case]] (supported for languages: ru, pl, cs, sl) | ||
* "case=ptv" for the [[: | * "case=ptv" for the [[:w:Partitive case|partitive case]] (supported for language: fi) | ||
* "case=ine" for the [[: | * "case=ine" for the [[:w:Inessive case|inessive case]] (supported for language: fi) | ||
* "case=ela" for the [[: | * "case=ela" for the [[:w:Elative case|elative case]] (supported for language: fi) | ||
* "case=ill" for the [[: | * "case=ill" for the [[:w:Illative case|illative case]] (supported for language: fi) | ||
|5label = case | |5label = case | ||
|5d-td = case | |5d-td = case | ||
| Line 35: | Line 36: | ||
|6=class | |6=class | ||
|6d-en=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 [[w:HCalendar|hCalendar]]). See [[Commons:Microformats Project|the microformats project]]. "class=" will remove all metadata. | |6d-en=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 [[w:HCalendar|hCalendar]]). See [[Commons:Microformats Project|the microformats project]]. "class=-" or "class=" will remove all metadata. | ||
|6label = class | |6label = class | ||
|6d-td = class | |6d-td = class | ||
| Line 53: | Line 54: | ||
|name=ISOdate | |name=ISOdate | ||
|desc=For a [[: | |desc=For a [[:w:ISO 8601#Calendar dates|calendar date in ISO 8601]] ''extended format'' in the form YYYY-MM-DD (e.g. "{{#time: Y-m-d }}"), with or without time, this template extracts the year, month, day and time, and calls {{tl|date}} with the year, month and day found to display the date in localised format, with the time, if specified, appended. It provides the convenience of passing on a date (or even a date and a time) from one template to another as a single parameter, even though {{tl|date}} eventually needs the date components separately. | ||
This template overcomes some flaws of the automatic conversion by <nowiki>{{#time: }}</nowiki> for non-full dates (e.g. "77-09" for September 77 AD, which would throw an error with <nowiki>{{#time: }}</nowiki>). | This template overcomes some flaws of the automatic conversion by <nowiki>{{#time: }}</nowiki> for non-full dates (e.g. "77-09" for September 77 AD, which would throw an error with <nowiki>{{#time: }}</nowiki>). | ||
| Line 75: | Line 76: | ||
|- | |- | ||
| | | | ||
:<code><nowiki>{{ISOdate|2010-11-01}}</nowiki></code>: {{ISOdate|2010-11-01}} | |||
:<code><nowiki>{{ISOdate|2010-08-18 18:15:30Z}}</nowiki></code>: {{ISOdate|2010-08-18 18:15:30Z}} | :<code><nowiki>{{ISOdate|2010-08-18 18:15:30Z}}</nowiki></code>: {{ISOdate|2010-08-18 18:15:30Z}} | ||
:<code><nowiki>{{ISOdate|2010-08-18 08:15:30}}</nowiki></code>: {{ISOdate|2010-08-18 08:15:30}} | :<code><nowiki>{{ISOdate|2010-08-18 08:15:30}}</nowiki></code>: {{ISOdate|2010-08-18 08:15:30}} | ||