Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
m (Reverted edits by Happy-melon (talk) to last version by Nsaa)
(try again)
Line 1: Line 1:
<includeonly>{{#if: ({{#time:Y-m-d|{{{1}}}}}={{{1}}} or {{#time:F j, Y|{{{1}}}}}={{{1}}} or {{#time:j F Y|{{{1}}}}}={{{1}}}) |
+
<onlyinclude><!--
{{#iferror:{{ #time:Y|{{{1}}} }}
+
 
  |{{{1|}}}
+
< -- TEST IF DATE IS CORRUPT OR A FRAGMENT -- >
  |{{ #ifeq:{{#time:U|{{{1}}} }} | 0 <!--TEST IF DATE IS CORRUPT OR OUT OF RANGE-->
+
-->{{#ifeq:{{#time:Y_M_d|{{{1|}}} 1999}}|{{#iferror: {{#time:Y_M_d|{{{1|}}} }} | *ERROR* }}
  |{{{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 | ymd     = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
      | ymd | iso = [[{{ #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|}}}
    |{{#switch: {{{2| }}}
+
    | mdy           = {{ #time:F j, Y|{{{1}}} }}  
      | mdy = {{ #time:F j, Y|{{{1}}} }}  
+
    | iso | ymd     = {{ #time:Y-m-d|{{{1}}} }}
      | ymd | iso = {{ #time:Y-m-d|{{{1}}} }}
+
    | dmy | #default = {{ #time:j F Y|{{{1}}} }}
      | dmy | #default = {{ #time:j F Y|{{{1}}} }}
+
   }}
    }}
+
   }}
    }}<span style="display:none">(<span class="bday">{{#time:Y-m-d|{{{1}}}}}</span>)</span>
+
  |{{{1|}}}
   }}  
+
}}</onlyinclude>
   }}
+
{{documentation}}
  |{{{1}}}
 
}}</includeonly><noinclude>{{documentation}}</noinclude>
 

Revision as of 06:58, 12 November 2008

Template documentation[create]