Modul:Chronik/Work
Aus FürthWiki
Die Dokumentation für dieses Modul kann unter Modul:Chronik/Work/Doku erstellt werden
local p = {}
local str = require("Modul:String")
local c = require("Modul:Common")
function p.dateParser(s, year)
dates = str.split(s, "-")
-- Wenn splitten mit "-" nur ein Ergebnis bringt, splitte mit "bis"
if c.len(dates) == 1 then
dates = str.split(s, "bis")
end
-- Alle Leerzeichen links und rechts in den Ergebnissen entfernen
for i, value in ipairs(dates) do
dates[i] = str.strip(dates[i])
end
for _, value in ipairs(dates) do
mw.log(value) -- oder print(value), wenn du es direkt in der Konsole sehen möchtest
end
return dates[1], dates[2], year
end
function p.Testfall(frame)
mw.addWarning("Mach kei gschmarrie, sonst kommst in a hurry!")
return "That's the text, my dear!"
end
return p