Module:Events

local f = require('Module:Functions') local p = {} p.data = mw.loadData('Module:Events/data') p.config = { currentEventPictureSizeX = 400, currentEventPictureSizeY = 200 }

local function checkTime(stop) local a = f.split(stop,"-") stop = os.time{hour = a[4], day = a[3], month = a[2], year = a[1]} return (os.time < stop) end

function p.currentEvent local data = {' '} local active = 0 for i, j in pairs(p.data) do		if(checkTime(j.endDate)) then table.insert(data, ' ') table.insert(data,'') table.insert(data,' '..j.endDate..' ') table.insert(data, ' ') active = active+1 end end table.insert(data, ' ') if(active == 0) then table.insert(data,'There is no active event right now Add event here') end return table.concat(data,"\n") end

function p.eventList return "" end

return p