Difference between revisions of "Template:Daterangedash"

From blackwiki
Jump to navigation Jump to search
imported>Howcheng
imported>Howcheng
(nowrap)
Line 1: Line 1:
 
{{#if:{{{3|}}}
 
{{#if:{{{3|}}}
 
|<!--has 3 parameters-->{{#ifexpr:{{#switch:{{{3}}}|dmy=1 |dm=1 | mdy=1 |md=1 |#default = 0}} = 0 |{{error|Date format must be one of the following: dmy, dm, mdy, md}}
 
|<!--has 3 parameters-->{{#ifexpr:{{#switch:{{{3}}}|dmy=1 |dm=1 | mdy=1 |md=1 |#default = 0}} = 0 |{{error|Date format must be one of the following: dmy, dm, mdy, md}}
   | {{#time:{{#ifexpr:{{str find0|{{{3}}}|md}} > -1 | F j | j F}} | {{{1}}} }}{{#ifeq:{{str endswith|{{{3}}}|y }} | yes | {{#ifexpr:{{str find0|{{{3}}}|md}} > -1 |,|{{sp}}<!--no comma if day first--> }} {{#time:Y | {{{1}}} }}|<!--do nothing if year not in format string-->}}{{spaced ndash}}{{#time:{{#ifexpr:{{str find0|{{{3}}}|md}} > -1 | F j | j F}} | {{{2}}} }}{{#ifeq:{{str endswith|{{{3}}}|y }} | yes | {{#ifexpr:{{str find0|{{{3}}}|md}} > -1 |,|{{sp}}<!--no comma if day first--> }} {{#time:Y | {{{2}}} }}|<!--do nothing if year not in format string-->}} }}
+
   | {{nowrap|{{#time:{{#ifexpr:{{str find0|{{{3}}}|md}} > -1 | F j | j F}} | {{{1}}} }}}}{{#ifeq:{{str endswith|{{{3}}}|y }} | yes | {{#ifexpr:{{str find0|{{{3}}}|md}} > -1 |,|{{sp}}<!--no comma if day first--> }} {{#time:Y | {{{1}}} }}|<!--do nothing if year not in format string-->}}{{spaced ndash}}{{nowrap|{{#time:{{#ifexpr:{{str find0|{{{3}}}|md}} > -1 | F j | j F}} | {{{2}}} }}}}{{#ifeq:{{str endswith|{{{3}}}|y }} | yes | {{#ifexpr:{{str find0|{{{3}}}|md}} > -1 |,|{{sp}}<!--no comma if day first--> }} {{#time:Y | {{{2}}} }}|<!--do nothing if year not in format string-->}} }}
 
|<!--does not have 3 parameters--> {{error|Must have three parameters: start date, end date, and format (dmy/dm/mdy/md) }} }}
 
|<!--does not have 3 parameters--> {{error|Must have three parameters: start date, end date, and format (dmy/dm/mdy/md) }} }}

Revision as of 21:35, 19 September 2017

Must have three parameters: start date, end date, and format (dmy/dm/mdy/md)