Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Date/doc: Difference between revisions

Template page
No edit summary
No edit summary
Line 1: Line 1:
{{TemplateBox
{{TemplateBox


|1      = 1
|1      = year
|1aliases= 1
|1d-en  = number of the year
|1d-en  = number of the year
|1label = year
|1label = year
|1d-td  = year
|1d-td  = year
|1type  = number
|1type  = number
|1stat  = optional


|2      = 2
|2      = month
|2aliases= 2
|2d-en  = number of month in the year
|2d-en  = number of month in the year
|2label = month
|2label = month
|2d-td  = month
|2d-td  = month
|2type  = number
|2type  = number
|2stat  = optional


|3      = 3
|3      = day
|3aliases= 3
|3d-en  = number of day in the month
|3d-en  = number of day in the month
|3label = day
|3label = day
|3d-td  = day
|3d-td  = day
|3type  = number
|3type  = number
|3stat  = optional


|4      = 4
|4      = hour
|4d-en  = language code (overrides user's preferences)
|4d-en  = hour in 0-23 range
|4label = language
|4label = hour
|4d-td  = language
|4d-td  = hour
|4type  = string
|4type  = number
|4def  = language code of the user language
|4stat  = optional


|5=form
|5     = minute
|5d-en=allows to specify [[:en:Grammatical case|grammatical case]] for the month in YYYY-MM dates, for languages that use them. Possible cases:
|5d-en  = minutes in 0-59 range
|5label = minute
|5d-td  = minute
|5type  = number
|5stat  = optional
 
|6      = second
|6d-en  = seconds in 0-59 range
|6label = second
|6d-td  = second
|6type  = number
|6stat  = optional
 
|14      = lang
|14aliases= 4
|14d-en  = language code (overrides user's preferences)
|14label = language
|14d-td  = language
|14type  = string
|14def  = language code of the user language
|14stat  = optional
 
|15=case
|15alias= form
|15d-en=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]]
*leave blank for [[:en:Nominative case|nominative case]]
*"form=gen" for [[:en:Genitive case|genitive case]]
*"case=gen" for [[:en:Genitive case|genitive case]]
*"form=loc" for [[:en:Locative case|locative case]] (supported for pl, cs & sl languages)
*"case=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)
*"case=ins" for [[:en:Instrumental case|instrumental case]] (supported for ru, 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).
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).
|15label = case
|15d-td  = case
|15stat  = optional-


|6=class
|16=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.  
|16d-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.  
|6def=dtstart
|16label = class
|16d-td  = class
|16def  = dtstart
|16stat  = optional-




Line 64: Line 100:
|type=marker
|type=marker
|example=
|example=
|i18n-method=switch
|i18n-method=
|i18n-desc=
|i18n-desc=[[Module:I18n/date]]
|seealso={{tl|ISOdate}} – Template used to parse the date in {{tl|information}}<br\> {{tl|other date}} - Allows to specify a range of non-trivial date notations in a format that is localizable
|seealso={{tl|ISOdate}} – Template used to parse the date in {{tl|information}}<br\> {{tl|other date}} - Allows to specify a range of non-trivial date notations in a format that is localizable
|setscats=
|setscats=
|lines=one
|lines=one
|shorthand=
|shorthand=
|relieson={{tl|I18n month}}, {{tl|formatnum}}
|relieson=[[Module:Date]]
}}
}}


Line 76: Line 112:
[[Category:Time, date and calendar templates|{{PAGENAME}}]]
[[Category:Time, date and calendar templates|{{PAGENAME}}]]
[[Category:User interface language dependent templates|{{PAGENAME}}]]
[[Category:User interface language dependent templates|{{PAGENAME}}]]
[[Category:Lua-based templates|{{PAGENAME}}]]
</includeonly>
</includeonly>

Revision as of 19:14, 17 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

ParameterDescriptionDefaultStatus
year
1
yearnumber of the yearemptyoptional
month
2
monthnumber of month in the yearemptyoptional
day
3
daynumber of day in the monthemptyoptional
hourhourhour in 0-23 rangeemptyoptional
minuteminuteminutes in 0-59 rangeemptyoptional
secondsecondseconds in 0-59 rangeemptyoptional
lang
4
languagelanguage code (overrides user's preferences)language code of the user languageoptional
casecaseallows to specify grammatical case for the month in YYYY-MM dates, for languages that use them. Possible cases: Also Partitive (ptv), Inessive (ine), Elative (ela) and Illative (ill) cases are supported for Finnish language, in addition to Nominative and Genitive (gen).emptyoptional
classclassallows 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.dtstartoptional

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 ==


Cookies help us deliver our services. By using our services, you agree to our use of cookies.