Template:ISOdate/doc: Difference between revisions
Template page
More actions
without leading zeros |
mNo edit summary |
||
| Line 14: | Line 14: | ||
|name=ISOdate | |name=ISOdate | ||
|desc=Takes a [[:en: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, and hands it over to {{tl|date}} to display it in localised format. | |desc=Takes a [[:en: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, and hands it over to {{tl|date}} to display it in localised format. | ||
This template | 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>) | ||
|namespace=all | |namespace=all | ||
|usergroup=all | |usergroup=all | ||
Revision as of 11:10, 14 September 2010
Takes a calendar date in ISO 8601 extended format in the form YYYY-MM-DD (e.g. "2026-08-22"), with or without time, and hands it over to {{Date}} to display it in localised format. This template overcomes some flaws of the automatic conversion by {{#time: }} for non-full dates (e.g. "77-09" for September 77 AD, which would throw an error with {{#time: }})
Usage
{{ISOdate |1= |2= |f= |form= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Any proleptic Gregorian calendar or Gregorian calendar date between 1 January 1 AD and 31 December 9999 AD. Dates BC are not yet supported. Also incomplete dates are allowed: just the year or the year and the month. A year has to be written in full, without leading zeros. Optionally it is followed by a dash and a 2-digit month number; optionally this is followed by a dash and a 2-digit day number; optionally this is followed by the time. | empty | required | |
2 | language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) | value of {{int:Lang}} | optional | |
f | format ("Y" for year-only output ["{{ISOdate|2008-08-06|f=Y}}" will result in the output "6 August 2008") | empty | optional | |
form | allows to specify differing syntactic forms to apply to the date (e.g. in some Polish phrases the month must appear in genitive form instead of nominative, so you have to set form to gen | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
See also
Localization
This template is not intended to be localized.
Test cases
|
|
|