Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
(fix per editprotected)
(+offset functionality per talk req, and +show target fmt)
Line 1: Line 1:
{{#switch:none
+
<includeonly>{{subst:</includeonly><includeonly>empty template|{{error:not substituted|}}}}</includeonly><includeonly>{</includeonly><includeonly>{</includeonly><includeonly>date</includeonly><includeonly>|{{</includeonly><includeonly>subst:</includeonly><includeonly>#time:j F Y|{{</includeonly><includeonly>subst:</includeonly><includeonly>#iferror:{{</includeonly><includeonly>subst:</includeonly><includeonly>#time:Y|{{{1|*error*}}}}}||{{{1|}}} }}</includeonly><includeonly>}}</includeonly><noinclude><!--datefmt begin--></noinclude><includeonly>|{{</includeonly><includeonly>subst:</includeonly><includeonly>#switch:</includeonly><includeonly>{{subst:</includeonly><includeonly>lc:</includeonly><includeonly>{{{</includeonly><includeonly>2|</includeonly><includeonly>}}}}}|none|asis|mdy|lmdy|ymd|lymd|iso|liso|ldmy=</includeonly><includeonly><includeonly>{{subst:</includeonly><includeonly>lc:</includeonly><includeonly>{{{</includeonly><includeonly>2|</includeonly><includeonly>}}}}}|dmy|#default=dmy</includeonly><includeonly>}}</includeonly><noinclude><!--datefmt end--></noinclude><includeonly>}}</includeonly><noinclude>
|{{#iferror: {{#time:Y_M_d|{{{1|}}} }}|none}}
+
<!-- This template must be SUBSTITUTED -->
|{{#switch:{{lc:{{{2|}}}}}|none|asis=none}}
+
{{Documentation}}
|{{#ifexpr: {{#time:Y|{{{1|}}} }} < 1582|none}}<!--
+
<!-- Add cats and interwikis to the /doc subpage, not here! -->
--> = {{{1|}}}<!-- error or "none", so no formatting -->
 
|<!-- continue with formatting -->
 
  {{#ifeq:{{#time:Y|{{{1|1 Jan 2000}}} 2008}}{{#time:Y|{{{1|1 Jan 2000}}} 2004}}|20082004
 
  |<!-- no year -->
 
    {{#ifeq:{{#time:d|{{{1|}}} 2036}}|{{#time:d|{{{1|}}} }}
 
    |<!-- month+day -->{{#time:
 
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd     = [[:F j]]
 
      | mdy  | iso | ymd      = F j
 
      | ldmy | l                = [[:j F]]
 
      | #default                = j F
 
      }}|{{{1|}}} 2000 }}<!-- default='dmy' or null or "" or unsupported option -->
 
    |<!-- month only -->{{#time:
 
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd
 
      | ldmy | l                = [[F]]
 
      | #default               = F
 
      }}|{{{1|}}} 2000 }}<!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt -->
 
    }}
 
  |<!-- with year-->
 
    {{#if: {{#iferror:{{#time:j|2 {{{1|}}}}}|*D*|{{#iferror:{{#time:j|2000 {{{1|}}}}}|*D*| }}}}
 
    |<!-- day+month+year -->{{#time:
 
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy                    = [[:F j]], [[Y]]
 
      | mdy                    = F j, Y
 
      | liso                    = [[Y|Y-]][[F j|m-d]]<!-- i.e. [[Y-m-d]] -->
 
      | iso                    = Y-m-d
 
      | lymd                    = [[Y]] [[:F j]]
 
      | ymd                    = Y F j
 
      | ldmy | l                = [[:j F]] [[Y]]
 
      | #default                = j F Y
 
      }}|{{{1|}}} }}<!-- #default='dmy' or null or "" or unsupported option -->
 
    |<!-- month+year -->{{#time:
 
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd | ldmy | l  = [[:F Y]]
 
      | #default                = F Y
 
      }}|{{{1|}}} }}<!-- default='dmy'/'iso'/'mdy'/null/""/unsupported option -->
 
    }}
 
  }}   
 
}}<noinclude>
 
{{pp-template|small=yes}}
 
{{documentation}}
 
 
</noinclude>
 
</noinclude>

Revision as of 08:28, 29 December 2008

Template documentation[create]