17.831
Bearbeitungen
Keine Bearbeitungszusammenfassung |
(fix kal.month_names[) |
||
| (5 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
local p = {} | local p = {} | ||
local | |||
local com = require("Modul:Common") | |||
local str = require("Modul:String") | local str = require("Modul:String") | ||
local arr = require("Modul:Array") | local arr = require("Modul:Array") | ||
local kal = require("Modul:Kalender") | |||
function p.Kalender(frame) | function p.Kalender(frame) | ||
| Zeile 10: | Zeile 12: | ||
local day, month, month_nr | local day, month, month_nr | ||
local md, mu -- month down/month up | local md, mu -- month down/month up | ||
if | if com.len(ma) == 1 then | ||
day = 0 | day = 0 | ||
month = ma[1] | month = ma[1] | ||
| Zeile 18: | Zeile 20: | ||
end | end | ||
month_nr = kal.month_numbers[month] | |||
local t='<table class="wikitable monatsbox">'.. | local t='<table class="wikitable monatsbox">'.. | ||
| Zeile 37: | Zeile 34: | ||
t=t..'<th>[[' | t=t..'<th>[[' | ||
if day ~= 0 then | if day ~= 0 then | ||
mds = day..'. '.. | mds = day..'. '..kal.month_names[md] | ||
for i = 0, 2 do | for i = 0, 2 do | ||
mds = tostring(day-i)..'. '.. | mds = tostring(day-i)..'. '..kal.month_names[md] | ||
if mw.title.new(mds).exists then | if mw.title.new(mds).exists then | ||
break | break | ||
| Zeile 46: | Zeile 43: | ||
t=t..mds | t=t..mds | ||
else | else | ||
t=t..':Kategorie:'.. | t=t..':Kategorie:'..kal.month_names[md] | ||
end | end | ||
t=t..'|◄]]</th>'.. | t=t..'|◄]]</th>'.. | ||
| Zeile 60: | Zeile 57: | ||
t=t..'<th>[[' | t=t..'<th>[[' | ||
if day ~= 0 then | if day ~= 0 then | ||
mus = day..'. '.. | mus = day..'. '..kal.month_names[mu] | ||
for i = 0, 2 do | for i = 0, 2 do | ||
mus = tostring(day-i)..'. '.. | mus = tostring(day-i)..'. '..kal.month_names[mu] | ||
if mw.title.new(mus).exists then | if mw.title.new(mus).exists then | ||
break | break | ||
| Zeile 69: | Zeile 66: | ||
t=t..mus | t=t..mus | ||
else | else | ||
t=t..':Kategorie:'.. | t=t..':Kategorie:'..kal.month_names[mu] | ||
end | end | ||
t=t..'|►]]</th>' | t=t..'|►]]</th>' | ||
| Zeile 83: | Zeile 80: | ||
end | end | ||
function p.woche( | function p.woche(day, month) | ||
a=6 | local a = 6 | ||
if | if day == 29 then | ||
if arr.contains({'April', 'Juni', 'September', 'November'}, month) then | if arr.contains({'April', 'Juni', 'September', 'November'}, month) then | ||
a=1 | a=1 | ||
| Zeile 95: | Zeile 92: | ||
end | end | ||
t = '<tr>' | local t = '<tr>' | ||
for i= | for i=day, day + a do | ||
t=t..'<td align="right">[['..i..'. ' .. month .. '|' .. i .. ']]</td>' | t = t .. '<td align="right">[['..i..'. ' .. month .. '|' .. i .. ']]</td>' | ||
end | end | ||
t = t..'</tr>' | t = t..'</tr>' | ||