Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
(restore {{doc}} and {{pp-template}})
(remove 'only year' formatting - breaks yyyy-mm-dd)
Line 5: Line 5:
 
--> = {{{1|}}}<!-- error or "none", so no formatting -->
 
--> = {{{1|}}}<!-- error or "none", so no formatting -->
 
  |<!-- continue with formatting -->
 
  |<!-- continue with formatting -->
   {{#iferror: {{#expr:{{{1|dummy}}} }}
+
   {{#ifeq:{{#time:Y|{{{1|1 Jan 2000}}} 1996}}{{#time:Y|{{{1|1 Jan 2000}}} 2004}}|19962004
  |<!-- input is not just a solitary number -->
+
  |<!-- no year -->
    {{#ifeq:{{#time:Y|{{{1|1 Jan 2000}}} 1996}}{{#time:Y|{{{1|1 Jan 2000}}} 2004}}|19962004
+
    {{#ifeq:{{#time:d|{{{1|}}} 2036}}|{{#time:d|{{{1|}}} }}
    |<!-- no year -->
+
    |<!-- month+day -->{{#time:
      {{#ifeq:{{#time:d|{{{1|}}} 2036}}|{{#time:d|{{{1|}}} }}
+
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
      |<!-- month+day -->{{#time:
+
      | lmdy | liso | lymd      = [[:F j]]
        {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
+
      | mdy  | iso  | ymd      = F j
        | lmdy | liso | lymd      = [[:F j]]
+
      | ldmy | l                = [[:j F]]
        | mdy  | iso  | ymd      = F j
+
      | #default                = j F
        | ldmy | l                = [[:j F]]
+
      }}|{{{1|}}} 2000 }}<!-- default='dmy' or null or "" or unsupported option -->
        | #default                = j F
+
    |<!-- month only -->{{#time:
        }}|{{{1|}}} 2000 }}<!-- default='dmy' or null or "" or unsupported option -->
+
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
      |<!-- month only -->{{#time:
+
      | lmdy | liso | lymd  
        {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
+
      | ldmy | l                = [[F]]
        | lmdy | liso | lymd  
+
      | #default                = F
        | ldmy | l                = [[F]]
+
      }}|{{{1|}}} 2000 }}<!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt -->
        | #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 -->
 
      }}
 
 
     }}
 
     }}
   |<!-- input is a solitary number. Treat it as just a year. -->
+
   |<!-- with year-->
     {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
+
     {{#if: {{#iferror:{{#time:j|2 {{{1|}}}}}|*D*|{{#iferror:{{#time:j|2000 {{{1|}}}}}|*D*| }}}}
    | lmdy | liso | lymd  
+
    |<!-- day+month+year -->{{#time:
    | ldmy | l                = [[{{#expr:{{{1|}}} }}]]
+
      {{#switch: {{lc: {{#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
    | #default                = {{#expr:{{{1|}}} }}
+
      | 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 -->
 
     }}
 
     }}
 
   }}     
 
   }}     

Revision as of 10:06, 18 December 2008

18 December 2024 Lua error in Module:Effective_protection_level at line 60: attempt to index field 'TitleBlacklist' (a nil value).

Template documentation[create]