Difference between revisions of "Template:FestivalDates"

From Culture.si
(Created page with "FIXMEEEEE {{#arr:dataloop | {{#arr:split|{{{1|}}}|[\s,]+}} | each = {{#arr:loop | k=v | {{#arr:split|{{{1|}}}|[\s,]+}} | each = {{#set:Festival weeks={{#expr:{{{2|0}}}*...")
 
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
FIXMEEEEE
+
{{{dates = {{#str:replace|{{{1|}}}|\s|}}}}}
 
+
{{#arr:loop
{{#arr:dataloop
+
| i=chunk
| {{#arr:split|{{{1|}}}|[\s,]+}}
+
| {{#arr:split|{{{dates}}}|,+}}
| each = {{#arr:loop
+
| each = {{{
  | k=v
+
  dates = {{#arr:split|{{{chunk}}}|[-‐‑‒–—―]}}
  | {{#arr:split|{{{1|}}}|[\s,]+}}
+
| start_date = {{#arr:get|{{{dates}}}|0}}
  | each = {{#set:Festival weeks={{#expr:{{{2|0}}}*100 + {{{v|0}}}}}}}
+
| start = {{#timel:Ymd|{{{start_date}}}}}
  }}
+
| end_date = {{#arr:get|{{{dates}}}|1|{{{start_date}}}}}
 +
| end = {{#timel:Ymd|{{{end_date}}}}}
 +
| start_year = {{#timel:Y|{{{start_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}}}}}}}
 +
| weeks = {{#arr:series|{{{start_week}}}|{{{end_week}}}}}
 +
}}}
 +
{{#arr:loop
 +
| j = week
 +
|{{{weeks}}}
 +
| each = {{#set:Festival weeks={{{week}}}}}
 +
}}
 +
| last = {{#set:Festival start={{{start}}}}}{{#set:Festival end={{{end}}}}}
 
}}
 
}}

Latest revision as of 23:06, 21 January 2020