Template:Dl/n: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
(This fixes problems with "October 2006-November 2007" and "October-November 2007", but, again, raises complexity (in the case of a date range with months and years included, anyway). Do we want to support these inputs?) |
(Fix, so it doesn't register the (end) month as the (starting) year. [This fix gets situations like 26 November-4 December 2006 working]) |
||
Line 1: | Line 1: | ||
{{#if:{{{1|}}}|{{#iferror:{{#ifexpr:{{#explode:{{#explode:{{{1}}}||0}}|-|0}} <= 31 | {{#if:{{{1|}}}|{{#iferror:{{#ifexpr:{{#explode:{{#explode:{{{1}}}||0}}|-|0}} <= 31 | ||
|<!-- YYYY-MM-DD -->{{#if:{{#explode:{{{1}}}|-|1}} | |<!-- YYYY-MM-DD -->{{#if:{{#explode:{{{1}}}|-|1}} | ||
|<!-- R-R -->{{#iferror:{{#ifexpr:{{#explode:{{{1}}}|-|0}}>0}}|{{#ifeq:{{#explode:{{{1}}}||2}}|-|{{#explode:{{{1}}}||-1}}|{{#explode:{{#explode:{{{1}}}||2}}|-|0}}}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}||1}}|-|0}}}}-{{dl/n/d|{{#explode:{{{1}}}||0}}}}|{{#explode:{{{1}}}||-1}}-{{dl/n/m|{{#explode:{{{1}}}||-2}}}}-{{dl/n/d|{{#explode:{{{1}}}|-|0}}}}}}–{{#iferror:{{#ifexpr:{{#explode:{{#explode:{{{1}}}|-|1}}||0}} <= 31|<!-- R - YYYY-MM-DD -->{{#explode:{{#explode:{{{1}}}|-|1}}||2}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}|-|1}}||1}}}}-{{dl/n/d|{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}|<!-- R - YYYY -->{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}|<!-- R - YYYY-MM -->{{#explode:{{#explode:{{{1}}}|-|1}}||1}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}}} | |<!-- R-R -->{{#iferror:{{#ifexpr:{{#explode:{{{1}}}|-|0}}>0}}|{{#ifeq:{{#explode:{{{1}}}||2}}|-|{{#explode:{{{1}}}||-1}}|{{#if:{{#explode:{{#explode:{{{1}}}|-|0}}||2}}|{{#explode:{{#explode:{{{1}}}|-|0}}||2}}|{{#explode:{{{1}}}||-1}}}}}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}||1}}|-|0}}}}-{{dl/n/d|{{#explode:{{{1}}}||0}}}}|{{#explode:{{{1}}}||-1}}-{{dl/n/m|{{#explode:{{{1}}}||-2}}}}-{{dl/n/d|{{#explode:{{{1}}}|-|0}}}}}}–{{#iferror:{{#ifexpr:{{#explode:{{#explode:{{{1}}}|-|1}}||0}} <= 31|<!-- R - YYYY-MM-DD -->{{#explode:{{#explode:{{{1}}}|-|1}}||2}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}|-|1}}||1}}}}-{{dl/n/d|{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}|<!-- R - YYYY -->{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}|<!-- R - YYYY-MM -->{{#explode:{{#explode:{{{1}}}|-|1}}||1}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}|-|1}}||0}}}}}} | ||
|<!-- D -->{{#explode:{{{1}}}||2}}-{{dl/n/m|{{#explode:{{{1}}}||1}}}}-{{dl/n/d|{{#explode:{{{1}}}||0}}}} | |<!-- D -->{{#explode:{{{1}}}||2}}-{{dl/n/m|{{#explode:{{{1}}}||1}}}}-{{dl/n/d|{{#explode:{{{1}}}||0}}}} | ||
}} | }} |