Module:Sandbox/Xoristzatziki/testparams

_calendar ={}

--αρχή μεταβλητής justanenter justanenter = [=[ ]=] --τέλος μεταβλητής justanenter

mhnas = { {['name'] = 'Ιανουάριος', ['gen'] = 'Ιανουαρίου'}, {['name'] = 'Φεβρουάριος', ['gen'] = 'Φεβρουαρίου'}, {['name'] = 'Μάρτιος', ['gen'] = 'Μαρτίου'}, {['name'] = 'Απρίλιος', ['gen'] = 'Απριλίου'}, {['name'] = 'Μάιος', ['gen'] = 'Μαΐου'}, {['name'] = 'Ιούνιος', ['gen'] = 'Ιουνίου'}, {['name'] = 'Ιούλιος', ['gen'] = 'Ιουλίου'}, {['name'] = 'Αύγουστος', ['gen'] = 'Αυγούστου'}, {['name'] = 'Σεπτέμβριος', ['gen'] = 'Σεπτεμβρίου'}, {['name'] = 'Οκτώβριος', ['gen'] = 'Οκτωβρίου'}, {['name'] = 'Νοέμβριος', ['gen'] = 'Νοεμβρίου'}, {['name'] = 'Δεκέμβριος', ['gen'] = 'Δεκεμβρίου'}, }

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;" 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 .. [=[
 * - 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%"| Σαβ.
 * -]=]

return newtable end
 * colspan="7"|
 * - style="background:]=] .. args['color2'] .. [=["
 * colspan="7"| ]=] .. args['yearlink'] .. justanenter .. [=[
 * }]=]

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