Difference between revisions of "Template:Date"

From Robowiki
Jump to navigation Jump to search
(Initial commit)
 
m (fix)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{{{|safesubst:}}}#switch:none
+
<!--
|{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#time:Y_M_d|{{{1|}}} }} | none }} <noinclude><!-- #time: can't handle --></noinclude>
+
-->{{ifeq|{{{2}}}|01|January }}<!--
|{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#expr: {{{1|}}}+0 }}
+
-->{{ifeq|{{{2}}}|02|February }}<!--
    |<noinclude><!--not a pure number--></noinclude>
+
-->{{ifeq|{{{2}}}|03|March }}<!--
    |{{{{{|safesubst:}}}#ifexpr: {{{1|}}}+0 > 10000000000000
+
-->{{ifeq|{{{2}}}|04|April }}<!--
      |<noinclude><!-- a yyyymmddhhmmss timestamp --></noinclude>
+
-->{{ifeq|{{{2}}}|05|May }}<!--
      |{{{{{|safesubst:}}}#ifeq: {{{{{|safesubst:}}}#expr:{{{1|}}}+0}} | {{{1|}}}
+
-->{{ifeq|{{{2}}}|06|June }}<!--
          | none <noinclude><!-- pure number eg 123.456 --></noinclude>
+
-->{{ifeq|{{{2}}}|07|July }}<!--
          | <noinclude><!-- assume yy-mm-dd --></noinclude>
+
-->{{ifeq|{{{2}}}|08|August }}<!--
        }}
+
-->{{ifeq|{{{2}}}|09|September }}<!--
    }}
+
-->{{ifeq|{{{2}}}|10|October }}<!--
  }}
+
-->{{ifeq|{{{2}}}|11|November }}<!--
|{{{{{|safesubst:}}}#switch:  {{{{{|safesubst:}}}lc:{{{2|}}}}} | none | asis | link | lnone =none }}
+
-->{{ifeq|{{{2}}}|12|December }}<!--
|{{{{{|safesubst:}}}#ifexpr:  {{{{{|safesubst:}}}#time:Y|{{{1|}}} }} < 1000 | none }}
+
 
|{{{{{|safesubst:}}}#switch:  {{{{{|safesubst:}}}#time:Ynj|{{{1|}}} }}|100031|110031|130031|140031|150031=none}}
+
-->{{ifeq|{{{2}}}|1|January }}<!--
|= {{{{{|safesubst:}}}#if:{{{1|}}}
+
-->{{ifeq|{{{2}}}|2|February }}<!--
      |{{{{{|safesubst:}}}#switch:{{{2}}}
+
-->{{ifeq|{{{2}}}|3|March }}<!--
        |link|lnone|l=[[{{{1}}}]]
+
-->{{ifeq|{{{2}}}|4|April }}<!--
        |{{{1}}}
+
-->{{ifeq|{{{2}}}|5|May }}<!--
      }}
+
-->{{ifeq|{{{2}}}|6|June }}<!--
    }}<noinclude><!-- error or "none", so no formatting --></noinclude>
+
-->{{ifeq|{{{2}}}|7|July }}<!--
|<noinclude><!-- continue with formatting --></noinclude>
+
-->{{ifeq|{{{2}}}|8|August }}<!--
  {{{{{|safesubst:}}}#ifeq:<noinclude><!--
+
-->{{ifeq|{{{2}}}|9|September }}<!--
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2008}}<noinclude><!--
+
 
    --></noinclude>{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#ifexpr: {{{1}}}>10000000000000 | no }} | }}<noinclude><!--
+
 
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2004}}
+
-->{{ifeq|{{{2|??}}}|?|? }}<!--
  |20082004
+
 
  |<noinclude><!-- no year --></noinclude>
+
 
    {{{{{|safesubst:}}}#ifeq:{{{{{|safesubst:}}}#time:d|{{{1}}} 2036}}|{{{{{|safesubst:}}}#time:d|{{{1}}} }}
+
--> {{if|test={{{3|}}}|then={{{3}}}, {{{1}}}}}<!--
    |<noinclude><!-- month+day --></noinclude>{{{{{|safesubst:}}}#time:
+
--><noinclude>
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
+
Usage:
      | lmdy | liso | lymd      = [[:F j]]
+
 
      | mdy  | iso  | ymd      = F j
+
<pre>'''{{date|2018|01|21}}'''</pre>
      | ldmy | l                = [[:j F]]
+
 
      | #default                = j F
+
Example:
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy' or null or "" or unsupported option --></noinclude>
+
 
    |<noinclude><!-- month only --></noinclude>{{{{{|safesubst:}}}#time:
+
'''{{date|2018|01|21}}'''
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
+
</noinclude>
      | lmdy | liso | lymd
 
      | ldmy | l                = [[F]]
 
      | #default                = F
 
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt --></noinclude>
 
    }}
 
  |<noinclude><!-- with year--></noinclude>
 
    {{{{{|safesubst:}}}#if: {{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2 {{{1|}}}}}|*D*|{{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2000 {{{1|}}}}}|*D*| }}}}
 
    |<noinclude><!-- day+month+year --></noinclude>{{{{{|safesubst:}}}#time:
 
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | 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>
 
    }}
 
  }}   
 
}}
 

Latest revision as of 04:55, 21 January 2018

Usage:

'''{{date|2018|01|21}}'''

Example:

January 21, 2018