82.367
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 6: | Zeile 6: | ||
function p.Eintrag(frame) | function p.Eintrag(frame) | ||
local title = mw.title.getCurrentTitle().text | |||
local daterange = frame.args[1] | local daterange = frame.args[1] | ||
local text = frame.args[2] or "" | local text = frame.args[2] or "" | ||
local nodate = frame.args[3] | local nodate = frame.args[3] | ||
local thema = frame.args["Thema"] or "Ereignis" | local thema = frame.args["Thema"] or "Ereignis" | ||
local year = nil | |||
local data = p.dateParser(daterange, | if c.istJahreszahl(title) then | ||
local ds = '[[' .. data['Starttag'] .. ']] [[' .. data['Startjahr'] ..']]' | year = title | ||
end | |||
local data = p.dateParser(daterange, year) | |||
local ds = '[[' .. data['Starttag'] .. ']]' | |||
if not year then | |||
ds = ds .. ' [[' .. data['Startjahr'] ..']]' | |||
end | |||
if data['Enddatum'] then | if data['Enddatum'] then | ||
ds = ds .. " - [[" .. data['Endtag'] .. "]] [[" .. data['Endjahr'] .. "]]" | ds = ds .. " - [[" .. data['Endtag'] .. "]]" | ||
if not year then | |||
ds = ds .. " [[" .. data['Endjahr'] .. "]]" | |||
end | |||
end | end | ||