local TableTools = require('Module:TableTools')local p =
function p.main(frame) no_of_entries = TableTools.size(frame.args)/2 state, day, evs, year =,,, i = 1 while (i <= no_of_entries) do state[i] = frame.args[2*i-1] day[i] = frame.args[2*i]-- evs[i] = frame:expandTemplate i = i + 1 end
-- Match up leave entries with start entries start_state, start_date, start_year, end_date, end_year =,,,, i = 1 j = 1 while (i <= no_of_entries) do if not (mw.ustring.match(state[i],'-')) then start_state[j] = state[i] start_date[j] = day[i] start_year[j] = tonumber(mw.ustring.match(day[i], "%d%d%d%d")) j = j + 1 else leave_state = mw.ustring.match(state[i],'%a%a') for k, state_name in ipairs(start_state) do if (leave_state
return start_state[12] .. " " .. start_date[12] .. " " .. start_year[12] .. " " .. end_date[10]end
return p