Bürokraten, Oberflächenadministratoren, SMW-Administratoren, SMW-Kuratoren, SMW-Editoren, Oversighter, Administratoren, Widget-Bearbeiter
204.491
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 26: | Zeile 26: | ||
date_array=split(date, "/") | date_array=split(date, "/") | ||
t = "{{#set:" .. attr_date .. "=" .. date .. "}}" | |||
if isEmpty(date_array[1]) then | if isEmpty(date_array[1]) then | ||
-- When datestring contained no "/" | -- When datestring contained no "/" | ||
if isInteger(date_array[0]) then | if isInteger(date_array[0]) then | ||
-- When dateformat is just YYYY | -- When dateformat is just YYYY | ||
return "[[" .. attr_year .. "::" .. date_array[0] .. "]]" | return t .. "[[" .. attr_year .. "::" .. date_array[0] .. "]]" | ||
else | else | ||
-- Dateformat is <monthname> YYYY | -- Dateformat is <monthname> YYYY | ||
mda = split(date_array[0]) | mda = split(date_array[0]) | ||
return mda[0] .. " [[" .. attr_year .. "::" .. mda[1] .. "]]" | return t .. mda[0] .. " [[" .. attr_year .. "::" .. mda[1] .. "]]" | ||
end | end | ||
elseif isEmpty(date_array[2]) then | elseif isEmpty(date_array[2]) then | ||
-- Datestring contained one "/" | -- Datestring contained one "/" | ||
mn = months[tonumber(date_array[1])] | mn = months[tonumber(date_array[1])] | ||
return mn .. " [[" .. attr_year .. "::" .. date_array[0] .. "]]" | return t .. mn .. " [[" .. attr_year .. "::" .. date_array[0] .. "]]" | ||
else | else | ||
-- Dateformat should be YYYY/MM/DD | -- Dateformat should be YYYY/MM/DD | ||
mn = months[tonumber(date_array[1])] | mn = months[tonumber(date_array[1])] | ||
date_array[2] = string.gsub(date_array[2], '0*', '', 1) | date_array[2] = string.gsub(date_array[2], '0*', '', 1) | ||
return "[[" .. attr_day .. "::" .. date_array[2] .. ". " .. mn .. "]]" .. | return t .. "[[" .. attr_day .. "::" .. date_array[2] .. ". " .. mn .. "]]" .. | ||
" [[" .. attr_year .. "::" .. date_array[0] .. "]]" | " [[" .. attr_year .. "::" .. date_array[0] .. "]]" | ||
end | end | ||
return | return t | ||
end | end | ||
return p | return p |
Bearbeitungen