Module:Poll/datecell/datespan

local p = {}

function p.getDateSpan( frame ) -- d1, d2 => y1,y2; m1,m2; d1,d2 dates = { mw.text.split(frame.args[1],'-',plain), mw.text.split(frame.args[2],'-',plain) } ft = '' -- Days if (dates[1] ~= dates[2]) then ft = ft .. tonumber(dates[1][3]) end -- Months if (dates[1][1]..dates[1][2] ~= dates[2][1]..dates[2][2]) then ft = ft .. ' ' .. months[tonumber(dates[1][2])] end -- Years if (dates[1][1] ~= dates[2][1]) then ft = ft .. ' ' .. dates[1][1] end ft = ft .. '–'	ft = ft .. tonumber(dates[2][3]) .. ' ' .. months[tonumber(dates[2][2])] .. ' ' .. dates[2][1] --years need to be made optional return ft end

months = {'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'}

return p