Modul:LinkSubformDatum: Unterschied zwischen den Versionen
Aus FürthWiki
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 5: | Zeile 5: | ||
pf = frame:getParent() | pf = frame:getParent() | ||
args = pf.args | args = pf.args | ||
months={ | |||
[1] = "Januar", | |||
[2] = "Februar", | |||
[3] = "März", | |||
[4] = "April", | |||
[5] = "Mai", | |||
[6] = "Juni", | |||
[7] = "Juli", | |||
[8] = "August", | |||
[9] = "September", | |||
[10] = "Oktober", | |||
[11] = "November", | |||
[12] = "Dezember"} | |||
date = args[1] | date = args[1] | ||
return " | date_array=split(date, "/") | ||
if isEmpty(date_array[2]) then | |||
return "" | |||
else | |||
mn = months[tonumber(date_array[1])] | |||
date_array[2] = string.gsub(date_array[2], '0*', '', 1) | |||
end | |||
return date_array[2] .. ". " .. mn | |||
end | end | ||
Zeile 13: | Zeile 35: | ||
args = pf.args | args = pf.args | ||
date = args[1] | date = args[1] | ||
date_array=split(date, "/") | |||
return date_array[0] | |||
end | end | ||
return p | return p |
Version vom 16. September 2024, 13:47 Uhr
Die Dokumentation für dieses Modul kann unter Modul:LinkSubformDatum/Doku erstellt werden
local p = {}
local c = require( "Module:Common" )
function p.GetMonthday(frame)
pf = frame:getParent()
args = pf.args
months={
[1] = "Januar",
[2] = "Februar",
[3] = "März",
[4] = "April",
[5] = "Mai",
[6] = "Juni",
[7] = "Juli",
[8] = "August",
[9] = "September",
[10] = "Oktober",
[11] = "November",
[12] = "Dezember"}
date = args[1]
date_array=split(date, "/")
if isEmpty(date_array[2]) then
return ""
else
mn = months[tonumber(date_array[1])]
date_array[2] = string.gsub(date_array[2], '0*', '', 1)
end
return date_array[2] .. ". " .. mn
end
function p.GetYear(frame)
pf = frame:getParent()
args = pf.args
date = args[1]
date_array=split(date, "/")
return date_array[0]
end
return p