Difference between revisions of "Template:Date"

From IntactiWiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
 
<includeonly>{{#switch:{{#invoke:String|len|s={{{1}}}}}
 
<includeonly>{{#switch:{{#invoke:String|len|s={{{1}}}}}
  |1 |2 |3 |4 |5 = {{#time:Y|{{{1}}} }}
+
  |0 |1 |2 =
 +
|3 |4 |5 = {{#time:Y|{{{1}}} }}
 
  |6 |7 |8 = {{#time:F Y|{{{1}}} }}
 
  |6 |7 |8 = {{#time:F Y|{{{1}}} }}
 
  |9 |10 = {{#time:j F Y|{{{1}}} }}
 
  |9 |10 = {{#time:j F Y|{{{1}}} }}
 
  |#default = <strong class="error">error</strong>[[Category:Pages with date format errors]]
 
  |#default = <strong class="error">error</strong>[[Category:Pages with date format errors]]
 
}}</includeonly><noinclude>== Examples ==
 
}}</includeonly><noinclude>== Examples ==
<pre>{{Date|999}}
+
<pre>{{Date|}}
 +
{{Date|999}}
 
{{Date|2019}}
 
{{Date|2019}}
 
{{Date|2019-}}</pre>
 
{{Date|2019-}}</pre>
 +
* {{Date|}}
 
* {{Date|999}}
 
* {{Date|999}}
 
* {{Date|2019}}
 
* {{Date|2019}}

Revision as of 14:41, 28 October 2019

Examples

{{Date|}}
{{Date|999}}
{{Date|2019}}
{{Date|2019-}}
  • Error: Invalid time.
  • 2019
  • Error: Invalid time.
{{Date|2019-3}}
{{Date|2019-03}}
{{Date|2019-03-}}
{{Date|03-2019}}
  • March 2019
  • March 2019
  • Error: Invalid time.
  • Error: Invalid time.
{{Date|2019-12-1}}
{{Date|2019-12-24}}
{{Date|2019-12-999}}
{{Date|01-03-2019}}
  • 1 December 2019
  • 24 December 2019
  • error
  • 1 March 2019