Template:Dts

From Iwe

(Difference between revisions)
 
Line 1: Line 1:
-
{{Documentation subpage}}
+
<includeonly>{{#if:{{{1|}}}|{{dts/{{#ifeq:{{#expr:{{{1|}}}0*0}}|0|core|hart}}|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|debug={{{debug|}}}|format={{{format|}}}|link={{#if:{{{link|}}}|off|no}}|nowrap={{{nowrap|}}}|Y=y}}|<!--
-
== Usage ==
+
-->{{dts/core|{{CURRENTYEAR}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|debug={{{debug|}}}|format={{{format|}}}|link={{#if:{{{link|}}}|off|no}}|nowrap={{{nowrap|}}}}}<!--
-
 
+
-->}}</includeonly>
-
Generates a localised date with appropriate attributes to make it sortable in a table.
+
-
 
+
-
<pre>
+
-
{{Date table sorting|date=2020-09-24|format=j F Y|lang=fr}}
+
-
</pre>
+
-
displays: {{Date table sorting|date=2020-09-24|format=j F Y|lang=fr}} and sorts well in a table.
+
-
 
+
-
=== Arguments ===
+
-
 
+
-
;lang: Language code (usually, you should pass <code><nowiki>{{PAGELANGUAGE}}</nowiki></code>).
+
-
;format: Deprecated (kept for backware compatibility)
+
-
;phpformat: Date display format: any string supported by <code><nowiki>{{#time}}</nowiki></code> (you can read [[mw:Special:MyLanguage/Help:Extension:ParserFunctions##time|its documentation page]]). Defaults to "j xg Y" (e.g. “6 January 2020”).
+
-
;precision: Instead of setting a phpformat, the module can guess it from date precision integer: <code>9</code> will display only year, <code>10</code> will display month and year, and <code>11</code> will display day, month and year. These values come from [[mw:Special:MyLanguage/Wikibase/DataModel#Dates_and_times|Wikidata date data model]].
+
-
;date: full date (takes precedence over other date arguments)
+
-
;year: year (takes precedence over numbered date arguments)
+
-
;month: month (works only if <var>year</var> is set)
+
-
;day: day (works only if both <var>year</var> and <var>month</var> are set)
+
-
;1: full date or year
+
-
;2: month (works only if <var>1</var> is set)
+
-
;3: day (works only if both <var>1</var> and <var>2</var> are set)
+
-
 
+
-
<includeonly>
+
-
[[Category:Modules for specific templates]]
+
-
</includeonly>
+

Current revision as of 11:59, 17 August 2024

Personal tools