Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
(this was from the Norwegian version... any guesses??)
(optimise code further)
Line 1: Line 1:
<includeonly>{{#iferror:{{ #time:U|{{{1}}} }}
+
<onlyinclude><!--
  |{{{1|}}}
+
 
  |{{ #ifeq:{{#time:U|{{{1}}} }}|0
+
-->{{#ifeq: {{#iferror: {{#time:U|{{{1}}}}} | 0 }} | 0 <!--TEST IF DATE IS CORRUPT OR OUT OF RANGE-->
  |{{{1|}}}
+
|{{{1|}}}
  |{{ #ifeq:{{{3| }}}|y
+
|{{#ifeq: {{{3|}}}|y
    |{{#switch: {{{2| }}}
+
  |{{#switch: {{{2|}}}
      | mdy = [[{{ #time:F j|{{{1}}} }}]], [[{{ #time:Y|{{{1}}} }}]]
+
  | mdy           = [[{{ #time:F j|{{{1}}} }}]], [[{{ #time:Y|{{{1}}} }}]]
      | iso = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
+
  | iso | ymd     = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
      | ymd = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
+
  | dmy | #default = [[{{ #time:j F|{{{1}}} }}]] [[{{ #time:Y|{{{1}}} }}]]
      | dmy
+
  }}
      | #default = [[{{ #time:j F|{{{1}}} }}]] [[{{ #time:Y|{{{1}}} }}]]
+
  |{{#switch: {{{2|}}}
    }}
+
    | mdy           = {{ #time:F j, Y|{{{1}}} }}  
    |{{#switch: {{{2| }}}
+
    | iso | ymd     = {{ #time:Y-m-d|{{{1}}} }}
      | mdy = {{ #time:F j, Y|{{{1}}} }}  
+
    | dmy | #default = {{ #time:j F Y|{{{1}}} }}
      | iso = {{ #time:Y-m-d|{{{1}}} }}
+
  }}
      | ymd = {{ #time:Y-m-d|{{{1}}} }}
+
  }}
      | dmy  
+
}}</onlyinclude>
      | #default = {{ #time:j F Y|{{{1}}} }}
+
{{documentation}}
    }}
 
    }}  
 
  }}
 
  }}</includeonly><noinclude>{{documentation}}</noinclude>
 

Revision as of 15:03, 11 November 2008

Template documentation[create]