15.082
Bearbeitungen
(AdresseBis nur wenn verschieden zu AdresseVon) |
(+ fehlerhafte Zeiträume abfangen) |
||
| Zeile 106: | Zeile 106: | ||
function p.sortIndex(address) | function p.sortIndex(address) | ||
-- mw.log("sortIndex(address)") | |||
-- mw.logObject(address) | |||
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 129: | Zeile 131: | ||
bis_sort_index = 77777777 | bis_sort_index = 77777777 | ||
end | end | ||
end | |||
-- fehlerhafte Zeiträume abfangen | |||
if von_sort_index > bis_sort_index then | |||
von_sort_index = bis_sort_index | |||
end | end | ||
-- Übernahme fehlender Index von => bis oder umgekehrt | -- Übernahme fehlender Index von => bis oder umgekehrt | ||
| Zeile 137: | Zeile 143: | ||
bis_sort_index = von_sort_index | bis_sort_index = von_sort_index | ||
end | end | ||
-- mw.log(von_sort_index .. " - " .. bis_sort_index) | |||
return von_sort_index, bis_sort_index | return von_sort_index, bis_sort_index | ||
end | end | ||