15.075
Bearbeitungen
(+ fehlerhafte Zeiträume abfangen) |
(Kleinkram) |
||
| Zeile 79: | Zeile 79: | ||
end | end | ||
if e["AdresseVon"] ~= "" then | if e["AdresseVon"] ~= "" then | ||
if e["AdresseBis"] | if e["AdresseBis"] == "" then | ||
table.insert(bracket, "seit") | |||
table.insert(bracket, "seit " | |||
end | end | ||
table.insert(bracket, lfd.formatDate(e["AdresseVon"])) | |||
end | end | ||
if e["AdresseBis"] ~= "" and e["AdresseBis"] ~= e["AdresseVon"] then | if e["AdresseBis"] ~= "" and e["AdresseBis"] ~= e["AdresseVon"] then | ||
if e["AdresseVon"] ~= "" then | if e["AdresseVon"] ~= "" then | ||
table.insert(bracket, "- " | table.insert(bracket, "-") | ||
else | else | ||
table.insert(bracket, "bis " | table.insert(bracket, "bis") | ||
end | end | ||
table.insert(bracket, lfd.formatDate(e["AdresseBis"])) | |||
end | end | ||
if #bracket > 0 then | if #bracket > 0 then | ||
| Zeile 97: | Zeile 97: | ||
t = t .. "\n" | t = t .. "\n" | ||
end | end | ||
-- Kategorie: Fehlerhafte Adresse bei fehlerhaften Adress-Angaben | |||
-- if sort_index_fail then | |||
-- t = t .. "[[Kategorie:Fehlerhafte Adresse]]" | |||
-- end | |||
end | end | ||
| Zeile 108: | Zeile 113: | ||
-- mw.log("sortIndex(address)") | -- mw.log("sortIndex(address)") | ||
-- mw.logObject(address) | -- mw.logObject(address) | ||
-- Datums-Index holen | |||
local von_sort_index = p.smwDate2SortIndex(address["AdresseVon"], "von") | local von_sort_index = p.smwDate2SortIndex(address["AdresseVon"], "von") | ||
local bis_sort_index = p.smwDate2SortIndex(address["AdresseBis"], "bis") | local bis_sort_index = p.smwDate2SortIndex(address["AdresseBis"], "bis") | ||
| Zeile 131: | Zeile 137: | ||
bis_sort_index = 77777777 | bis_sort_index = 77777777 | ||
end | end | ||
-- Übernahme fehlender Index von | |||
elseif von_sort_index == 0 and bis_sort_index ~= 0 then | |||
-- Übernahme fehlender Index von | |||
von_sort_index = bis_sort_index | von_sort_index = bis_sort_index | ||
-- Übernahme fehlender Index bis | |||
elseif bis_sort_index == 0 and von_sort_index ~= 0 then | |||
bis_sort_index = von_sort_index | bis_sort_index = von_sort_index | ||
-- Korrektur von > bis | |||
elseif von_sort_index > bis_sort_index then | |||
von_sort_index = bis_sort_index -- den kleineren übernehmen | |||
end | end | ||
-- mw.log(von_sort_index .. " - " .. bis_sort_index) | -- mw.log(von_sort_index .. " - " .. bis_sort_index) | ||