Zum Inhalt springen

„Modul:Archivbot“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
[gesichtete Version][gesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:
local stamp = frame.args[1]
local stamp = frame.args[1]
local date
local date
if stamp and stamp ~= "" and stamp ~= "0" then
if stamp:match( "^20[12]%d%-[0-1]%d%-[0-3]%d" ) then
if stamp:match( "^20[12]%d%-[0-1]%d%-[0-3]%d" ) then
date = stamp:match("^20[12]%d%-[0-1]%d%-[0-3]%d")
else
date = stamp:match("^20[12]%d%-[0-1]%d%-[0-3]%d")
else
date = ""
date = ""
end
end
end
return stamp or ""
return stamp or ""

Version vom 24. März 2018, 09:47 Uhr

Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch

Modul: Dokumentation

Diese Seite enthält Code in der Programmiersprache Lua. Einbindungszahl Cirrus


local p = { }

p.getdate = function ( frame )
    local stamp = frame.args[1]
    local date
    if stamp:match( "^20[12]%d%-[0-1]%d%-[0-3]%d" ) then
        date = stamp:match("^20[12]%d%-[0-1]%d%-[0-3]%d")
    else
        date = ""
    end
    return stamp or ""
end -- p.getdate