Modul:RO: Unterschied zwischen den Versionen

Aus ipsc.de
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 6: Zeile 6:
  pt = title:getContent()
  pt = title:getContent()
  local match = os.date('%y')..'%-%d%d%-(%d%d+)'
  local match = os.date('%y')..'%-%d%d%-(%d%d+)'
  local new = '01'
  local new = 1
  for w in string.gmatch(pt, match) do
  for w in string.gmatch(pt, match) do
   if w > new then
  local num = tonumber(w)
   new = w + 1
   if num > new then
   new = num + 1
   end
   end
  end
  end
  return new
  return string.format("%02i", new)
end
end


return p
return p

Version vom 15. Dezember 2020, 18:26 Uhr

Die Dokumentation für dieses Modul kann unter Modul:RO/Doku erstellt werden

local p = {}

function p.next(frame)
 local page = frame.args[1]
 title  = mw.title .new(page)
 pt = title:getContent()
 local match = os.date('%y')..'%-%d%d%-(%d%d+)'
 local new = 1
 for w in string.gmatch(pt, match) do
  local num = tonumber(w)
  if num > new then
   new = num + 1
  end
 end
 return string.format("%02i", new)
end

return p