Difference between revisions of "Template:ISO8601"

From Wikispooks
Jump to navigation Jump to search
m (Fix)
m (Text replacement - "|Date" to "|publication_date")
Line 3: Line 3:
 
<poem>
 
<poem>
 
{{ISO8601  
 
{{ISO8601  
|DateYear= (0-9999)
+
|publication_dateYear= (0-9999)
|DateMonth= (1-12)
+
|publication_dateMonth= (1-12)
|DateDay= (1-31)
+
|publication_dateDay= (1-31)
 
}}
 
}}
 
</poem>
 
</poem>
 
</noinclude><includeonly>{{#substring:0000{{{DateYear|}}}| {{#strlen:{{{DateYear|}}} }} |4}}-{{#substring:0{{{DateMonth|}}}|{{#expr: {{#strlen:{{{DateMonth|}}}}} - 1}}|2}}-{{#substring:0{{{DateDay|}}}|{{#expr: {{#strlen:{{{DateDay|}}}}} - 1}}|2}}</includeonly>
 
</noinclude><includeonly>{{#substring:0000{{{DateYear|}}}| {{#strlen:{{{DateYear|}}} }} |4}}-{{#substring:0{{{DateMonth|}}}|{{#expr: {{#strlen:{{{DateMonth|}}}}} - 1}}|2}}-{{#substring:0{{{DateDay|}}}|{{#expr: {{#strlen:{{{DateDay|}}}}} - 1}}|2}}</includeonly>

Revision as of 13:23, 25 June 2014

Formats a date as ISO8601.
Usage:

{{ISO8601
|publication_dateYear= (0-9999)
|publication_dateMonth= (1-12)
|publication_dateDay= (1-31)
}}