82.367
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| (4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| 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 | local option = 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 | ||
data['Beschreibung'] = text | |||
data['Thema'] = thema | |||
mw.smw.subobject(data) | mw.smw.subobject(data) | ||
return ds .. ' ' .. text | if option == "nodate" then | ||
return text | |||
end | |||
return ds .. ': ' .. text | |||
end | end | ||
| Zeile 36: | Zeile 46: | ||
if end_date then | if end_date then | ||
local edf = lfd.humanToFormDate(end_date) | local edf = lfd.humanToFormDate(end_date) | ||
data['Enddatum'] = edf | |||
data['Endjahr'] = lsd.getYear(edf) | |||
data['Endtag'] = lsd.getMonthday(edf) | |||
end | end | ||
mw.logObject(data) | |||
return data | return data | ||
end | end | ||