Bürokraten, Oberflächenadministratoren, SMW-Administratoren, SMW-Kuratoren, SMW-Editoren, Oversighter, Administratoren, Widget-Bearbeiter
204.351
Bearbeitungen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 26: | Zeile 26: | ||
date_array=split(date, "/") | date_array=split(date, "/") | ||
mw.smw.set({[attr_date] = date}) | mw.smw.set({[attr_date] = date}) | ||
if isEmpty(date_array[1]) then | if isEmpty(date_array[1]) then | ||
Zeile 34: | Zeile 31: | ||
if isInteger(date_array[0]) then | if isInteger(date_array[0]) then | ||
-- When dateformat is just YYYY | -- When dateformat is just YYYY | ||
return | return "[[" .. 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 | return 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 | return 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 | return "[[" .. attr_day .. "::" .. date_array[2] .. ". " .. mn .. "]]" .. | ||
" [[" .. attr_year .. "::" .. date_array[0] .. "]]" | " [[" .. attr_year .. "::" .. date_array[0] .. "]]" | ||
end | end | ||
end | end | ||
return p | return p |
Bearbeitungen