Difference between revisions of "Template:Date"

From Timelines
Jump to: navigation, search
m (moved Template:ISOtodmymdy to Template:ISOtoMOS: Converts from ISO to Manual of style)
(Moved sandbox live to fix wrong output when substituted)
 
(43 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{#time:Y-m-d|{{{1}}}}}|{{{1}}}|
+
{{{{{|safesubst:}}}#switch:none
{{#iferror:{{ #time:Y|{{{1}}} }}
+
|{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#time:Y_M_d|{{{1|}}} }} | none }} <noinclude><!-- #time: can't handle --></noinclude>
  |{{{1|}}}
+
|{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#expr: {{{1|}}}+0 }}
  |{{ #ifeq:{{#time:U|{{{1}}} }}|0
+
    |<noinclude><!--not a pure number--></noinclude>
  |{{{1|}}}
+
    |{{{{{|safesubst:}}}#ifexpr: {{{1|}}}+0 > 10000000000000
  |{{ #ifeq:{{{2| }}}|n
+
      |<noinclude><!-- a yyyymmddhhmmss timestamp --></noinclude>
  |{{#switch: {{{3| }}}
+
      |{{{{{|safesubst:}}}#ifeq: {{{{{|safesubst:}}}#expr:{{{1|}}}+0}} | {{{1|}}}
      | mdy = {{ #time:F j, Y|{{{1}}} }}  
+
          | none <noinclude><!-- pure number eg 123.456 --></noinclude>
      | dmy = {{ #time:j F Y|{{{1}}} }}
+
          | <noinclude><!-- assume yy-mm-dd --></noinclude>
       | iso = {{ #time:Y-m-d|{{{1}}} }}
+
        }}
       | {{{1}}}
+
    }}
 +
  }}
 +
  |{{{{{|safesubst:}}}#switch:  {{{{{|safesubst:}}}lc:{{{2|}}}}} | none | asis | link | lnone =none }}
 +
|{{{{{|safesubst:}}}#ifexpr:  {{{{{|safesubst:}}}#time:Y|{{{1|}}} }} < 1000 | none }}
 +
  |{{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}#time:Ynj|{{{1|}}} }}|100031|110031|130031|140031|150031=none}}
 +
|= {{{{{|safesubst:}}}#if:{{{1|}}}
 +
      |{{{{{|safesubst:}}}#switch:{{{2}}}
 +
        |link|lnone|l=[[{{{1}}}]]
 +
        |{{{1}}}
 +
      }}
 +
    }}<noinclude><!-- error or "none", so no formatting --></noinclude>
 +
|<noinclude><!-- continue with formatting --></noinclude>
 +
  {{{{{|safesubst:}}}#ifeq:<noinclude><!--
 +
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2008}}<noinclude><!--
 +
    --></noinclude>{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#ifexpr: {{{1}}}>10000000000000 | no }} | }}<noinclude><!--
 +
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2004}}
 +
  |20082004
 +
  |<noinclude><!-- no year --></noinclude>
 +
    {{{{{|safesubst:}}}#ifeq:{{{{{|safesubst:}}}#time:d|{{{1}}} 2036}}|{{{{{|safesubst:}}}#time:d|{{{1}}} }}
 +
    |<noinclude><!-- month+day --></noinclude>{{{{{|safesubst:}}}#time:
 +
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 +
       | lmdy | liso | lymd      = [[:F j]]
 +
      | mdy  | iso | ymd      = F j
 +
      | ldmy | l                = [[:j F]]
 +
      | #default                = j F
 +
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy' or null or "" or unsupported option --></noinclude>
 +
    |<noinclude><!-- month only --></noinclude>{{{{{|safesubst:}}}#time:
 +
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 +
       | lmdy | liso | lymd
 +
      | ldmy | l                = [[F]]
 +
      | #default                = F
 +
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt --></noinclude>
 
     }}
 
     }}
  |{{#switch: {{{3| }}}
+
  |<noinclude><!-- with year--></noinclude>
      | mdy = [[{{ #time:F j|{{{1}}} }}]], [[{{ #time:Y|{{{1}}} }}]]
+
    {{{{{|safesubst:}}}#if: {{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2 {{{1|}}}}}|*D*|{{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2000 {{{1|}}}}}|*D*| }}}}
      | dmy = [[{{ #time:j F|{{{1}}} }}]] [[{{ #time:Y|{{{1}}} }}]]
+
    |<noinclude><!-- day+month+year --></noinclude>{{{{{|safesubst:}}}#time:
       | iso = [[{{ #time:Y|{{{1}}} }}]] [[{{ #time:F j|{{{1}}} }}|{{ #time:m-d|{{{1}}} }}]]
+
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
       | {{{1}}}
+
      | lmdy                    = [[:F j]], [[Y]]
 +
      | mdy                    = F j, Y
 +
      | liso                    = [[Y|Y-]][[F j|m-d]]<noinclude><!-- i.e. [[Y-m-d]] --></noinclude>
 +
       | iso                     = Y-m-d
 +
      | lymd                    = [[Y]] [[:F j]]
 +
      | ymd                    = Y F j
 +
      | ldmy | l                = [[:j F]] [[Y]]
 +
      | #default                = j F Y
 +
      }}|{{{1|}}} }}<noinclude><!-- #default='dmy' or null or "" or unsupported option --></noinclude>
 +
    |<noinclude><!-- month+year --></noinclude>{{{{{|safesubst:}}}#time:
 +
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 +
      | lmdy | liso | lymd | ldmy | l  = [[:F Y]]
 +
       | #default                = F Y
 +
      }}|{{{1|}}} }}<noinclude><!-- default='dmy'/'iso'/'mdy'/null/""/unsupported option --></noinclude>
 
     }}
 
     }}
  }}
+
   }}  
   }}  
+
}}<noinclude>
  }}<span style="display:none">(<span class="bday">{{{1}}}</span>)</span>
+
{{documentation}}
|{{{1}}}}}</includeonly><noinclude>{{documentation}}</noinclude>
+
</noinclude>

Latest revision as of 08:05, 12 September 2015

16 November 2024

Template documentation[create]