Template:Dl/n: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
(annoyingly, I hadn't accounted for situations such as "2-3 December 2016" or even "2 - 3 December 2016". So it needs an additional layer of complexity within DMY - R, unfortunately. better than adding complexity at a higher level, where it'd affect @) |
(This fix allows "September-9 December 2017" to function) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#if:{{{1|}}}|{{#iferror:{{#ifexpr:{{#explode:{{{1}}}||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 -->{{#ifexpr: | |<!-- 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}}}} | ||
}} | }} | ||
|<!-- YYYY -->{{#if:{{#explode:{{{1}}}|-|1}} | |<!-- YYYY -->{{#if:{{#explode:{{{1}}}|-|1}} | ||
|<!-- R-R -->{{#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 -->{{#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}}}||0}} | |<!-- D -->{{#explode:{{{1}}}||0}} | ||
}}}} | }}}} | ||
|<!-- YYYY-MM -->{{#if:{{#explode:{{{1}}}|-|1}} | |<!-- YYYY-MM -->{{#if:{{#explode:{{{1}}}|-|1}} | ||
|<!-- R-R -->{{#ifeq:{{#explode:{{{1}}}||1}}|-|{{#explode:{{{1}}}||-1}}|{{#explode:{{{1}}}||1}}}}-{{dl/n/m|{{#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 -->{{#ifeq:{{#explode:{{{1}}}||1}}|-|{{#explode:{{{1}}}||-1}}|{{#if:{{#explode:{{#explode:{{{1}}}|-|0}}||1}}|{{#explode:{{#explode:{{{1}}}|-|0}}||1}}|{{#explode:{{{1}}}||-1}}}}}}-{{dl/n/m|{{#explode:{{#explode:{{{1}}}||0}}|-|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}}}||1}}-{{dl/n/m|{{#explode:{{{1}}}||0}}}} | |<!-- D -->{{#explode:{{{1}}}||1}}-{{dl/n/m|{{#explode:{{{1}}}||0}}}} | ||
}}}} | }}}} | ||
}}<noinclude>[[Category:Date calculation templates]][[Category:Template sandbox]]</noinclude> | }}<noinclude>[[Category:Date calculation templates]][[Category:Template sandbox]]</noinclude> |