Difference between revisions of "Template:FestivalDates"

From Culture.si
Line 1: Line 1:
 
FIXMEEEEE
 
FIXMEEEEE
{{{dates = {{#str:replace|{{{1|23.3.2015, 24.3.2014 - 27.3. 2014}}}|\s|}}}}}
+
{{{dates = {{#str:replace|{{{1|23.3.2015, 24.3.2014 - 27.5. 2014}}}|\s|}}}}}
 
 
 
{{#arr:loop
 
{{#arr:loop
| i=year
+
| i=chunk
 
| {{#arr:split|{{{dates}}}|,+}}
 
| {{#arr:split|{{{dates}}}|,+}}
| each =  
+
| each = {{{
YEAR: {{{year}}}
+
   dates = {{#arr:split|{{{chunk}}}|[-–]}}
{{{
 
   dates = {{#arr:split|{{{year}}}|[-–]}}
 
 
| start_date = {{#arr:get|{{{dates}}}|0}}
 
| start_date = {{#arr:get|{{{dates}}}|0}}
 
| end_date = {{#arr:get|{{{dates}}}|1|{{{start_date}}}}}
 
| end_date = {{#arr:get|{{{dates}}}|1|{{{start_date}}}}}
| start_week = {{#timel:W|{{{start_date}}}}}
+
| start_year = {{#timel:Y|{{{start_date}}}}}
| end_week = {{#timel:W|{{{end_date}}}}}
+
| end_year = {{#timel:Y|{{{end_date}}}}}
}}}
+
| start_week = {{#expr:100*{{{start_year}}}+{{#timel:W|{{{start_date}}}}}}}
 
+
| end_week = {{#expr:100*{{{end_year}}}+{{#timel:W|{{{end_date}}}}}}}
{{#arr:list|{{{dates}}}}}
+
| weeks = {{#arr:series|{{{start_week}}}|{{{end_week}}}}}
 
+
}}}{{#arr:loop
{{{start_week}}} {{{end_week}}}
+
| j = week
 
+
|{{{weeks}}}
 
+
| each = {{#set:Festival weeks={{{week}}}}}
}}
+
}}}}

Revision as of 19:07, 3 June 2015

FIXMEEEEE