Zum Inhalt springen

„Modul:Archivbot“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
[gesichtete Version][gesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
AZ: Die Seite wurde neu angelegt: local p = { } p.getdate = function ( frame ) local stamp = frame.args[1] local date if st…
 
Keine Bearbeitungszusammenfassung
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
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")
else
date = stamp.match("^20[12]%d%-[0-1]%d%-[0-3]%d")
else
date = "ohne Datum"
date = ""
end
end
end
return date
return date or ""
end -- p.getdate
end -- p.getdate

return p

Aktuelle Version vom 24. März 2018, 10:49 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")
    else
        date = "ohne Datum"
    end
    return date or ""
end -- p.getdate

return p