_calendar =
--αρχή μεταβλητής justanenterjustanenter = [=[ ]=]--τέλος μεταβλητής justanenter
mhnas =
fulltableforcal1 = function (args) local currentdays = local tmpnum = 0 local monthon = mhnas[tonumber(args['Μήνας'])].name local monthg = mhnas[tonumber(args['Μήνας'])].gen local firstday = tonumber(args['day1']) for xcounter = 1,7 do if firstday > xcounter then currentdays[xcounter] = '|colspan="1"| ' else tmpnum = (xcounter - firstday + 1) currentdays[xcounter] = '| ' .. tmpnum ..'' end end for xcounter = 8,28 do tmpnum = (xcounter - firstday + 1) currentdays[xcounter] = '| ' .. tmpnum ..'' end for xcounter = 29,35 do if args['daycount'] + firstday > xcounter then tmpnum = (xcounter - firstday + 1) currentdays[xcounter] = '| ' .. tmpnum ..'' else currentdays[xcounter] = '|colspan="1"| ' end end
newtable = [=[{| class="toccolours" style="float:]=] .. args['float'] .. [=[; margin-left: 1em; text-align:center;" |- style="background:]=] .. args['color'] .. [=[;" |colspan="7"|'''[[]=] .. monthon .. [=[]] |- style="background:]=] .. args['color2'] .. [=[;" |width="14%"| Κυρ. |width="14%"| Δευτ. |width="14%"| Τρ. |width="14%"| Τετ. |width="14%"| Πεμ. |width="14%"| Παρ. |width="14%"| Σαβ. |-]=] local daytoshow = 0 for ycounter = 1,5 do for xcounter = 1,7 do --if ycounter < 2 then --daytoshow = xcounter --else daytoshow = (((ycounter - 1) * 7) + xcounter) --mw.log(type(daytoshow)) newtable = newtable .. justanenter .. currentdays[daytoshow] .. justanenter end newtable = newtable .. justanenter .. '|-' end newtable = newtable .. [=[ |colspan="7"| |- style="background:]=] .. args['color2'] .. [=[" |colspan="7"| ]=] .. args['yearlink'] .. justanenter .. [=[ |}]=] return newtableend
function _calendar.Cal1(frame) local args = frame.args return frame:preprocess(fulltableforcal1(args))end
function _calendar.test local args = args['color2'] = '#ccccff'-- args['Μήνας'] = 'Ιούλιος' args['Μήνας'] = 6-- args['Γεν-Μήνα'] = 'Ιουλίου' args['color'] = '#ccccff' args['color2'] = 'ccccff' args['1day'] = 2 args['float'] = 'float' args['yearlink'] = '2013' args['daycount'] = 30-- args[1] = 'arg1'-- args['1a'] = 'arg1a'-- args[2] = 'arg2'-- args[3] = 'arg3'-- args[4] = 'arg4' return fulltableforcal1(args)end return _calendar