Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
(optimise code further)
(restore ({{#time:Y-m-d|{{{1}}}}}={{{1}}} or {{#time:F j, Y|{{{1}}}}}={{{1}}} or {{#time:j F Y|{{{1}}}}}={{{1}}}). It shouldnt be allowed to give dates outside MOS. Restored bday, See H-card)
Line 1: Line 1:
<onlyinclude><!--
+
<includeonly>{{#if: ({{#time:Y-m-d|{{{1}}}}}={{{1}}} or {{#time:F j, Y|{{{1}}}}}={{{1}}} or {{#time:j F Y|{{{1}}}}}={{{1}}}) |
 
+
{{#iferror:{{ #time:Y|{{{1}}} }}
-->{{#ifeq: {{#iferror: {{#time:U|{{{1}}}}} | 0 }} | 0 <!--TEST IF DATE IS CORRUPT OR OUT OF RANGE-->
+
  |{{{1|}}}
|{{{1|}}}
+
  |{{ #ifeq:{{#time:U|{{{1}}} }} | 0 <!--TEST IF DATE IS CORRUPT OR OUT OF RANGE-->
|{{#ifeq: {{{3|}}}|y
+
  |{{{1|}}}
  |{{#switch: {{{2|}}}
+
  |{{ #ifeq:{{{3| }}}|y
  | mdy           = [[{{ #time:F j|{{{1}}} }}]], [[{{ #time:Y|{{{1}}} }}]]
+
    |{{#switch: {{{2| }}}
  | iso | ymd      = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
+
      | mdy = [[{{ #time:F j|{{{1}}} }}]], [[{{ #time:Y|{{{1}}} }}]]
  | dmy | #default = [[{{ #time:j F|{{{1}}} }}]] [[{{ #time:Y|{{{1}}} }}]]
+
      | ymd | iso = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{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}}} }}
+
      | ymd | iso = {{ #time:Y-m-d|{{{1}}} }}
   }}
+
      | dmy | #default = {{ #time:j F Y|{{{1}}} }}
   }}   
+
    }}
}}</onlyinclude>
+
    }}  
{{documentation}}
+
   }}  
 +
   }}<span style="display:none">(<span class="bday">{{#time:Y-m-d|{{{1}}}}}</span>)</span>
 +
  |{{{1}}}
 +
}}</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 03:20, 12 November 2008

Template documentation[create]