Difference between revisions of "Template:Event infobox"

no edit summary
Line 4: Line 4:
   {{#vardefine:duration array|{{{duration|}}}
   {{#vardefine:duration array|{{{duration|}}}
}}{{#vardefine:duration loop|1
}}{{#vardefine:duration loop|1
}}{{#vardefine:duration earliest start|{{#time:U|December 31, 3000}}
}}{{#vardefine:duration latest end|{{#time:U|December 2nd, 2016}}
}}{{#while:|{{#var:duration loop}}|
}}{{#while:|{{#var:duration loop}}|
{{#vardefine:duration array piece|
{{#vardefine:duration array piece|
Line 37: Line 35:
   }}{{#ifexpr:{{#time: U|now}} >= {{#time:U|{{#var:duration array piece start}}}} and {{#time: U|now}} <= {{#time: U|{{#var:duration array piece end}}}}|
   }}{{#ifexpr:{{#time: U|now}} >= {{#time:U|{{#var:duration array piece start}}}} and {{#time: U|now}} <= {{#time: U|{{#var:duration array piece end}}}}|
     {{#vardefine:is active|true}}
     {{#vardefine:is active|true}}
   }}{{#vardefineecho:duration array piece start|{{#time:U|{{#var:duration array piece start}}}}
   }}{{#vardefine:duration array piece start|{{#time:U|{{#var:duration array piece start}}}}
   }}{{#vardefineecho:duration array piece end|{{#time:U|{{#var:duration array piece start}}}}
   }}{{#vardefine:duration array piece end|{{#time:U|{{#var:duration array piece start}}}}
   }}{{#ifexpr:{{#var:duration array piece start}} <= {{#var:duration earliest start}}|{{#vardefine:duration earliest start|{{#var:duration array piece start}}}}
   }}{{#ifexpr:{{#var:duration array piece start}} <= {{#var:duration earliest start|{{#time:U|December 31, 3000}}}}|{{#vardefine:duration earliest start|{{#var:duration array piece start}}}}
   }}{{#ifexpr:{{#var:duration array piece end}} >= {{#var:duration latest end}}|{{#vardefine:duration latest end|{{#var:duration array piece end}}}}
   }}{{#ifexpr:{{#var:duration array piece end}} >= {{#var:duration latest end|{{#time:U|December 2nd, 2016}}}}|{{#vardefine:duration latest end|{{#var:duration array piece end}}}}
   }}
   }}
}}{{#if:{{#pos:{{#var:duration array}}|;}}||
}}{{#if:{{#pos:{{#var:duration array}}|;}}||