Modul:RO: Unterschied zwischen den Versionen

Aus ipsc.de
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 17: Zeile 17:
  return out
  return out
end
end
function p.next2(frame)
function p.next2(frame)
  frame = frame:getParent()
  frame = frame:getParent()
Zeile 32: Zeile 33:
  local lv = tonumber(string.match(page, '%d+'))
  local lv = tonumber(string.match(page, '%d+'))
  local out = os.date('%y')..'-'..string.format("%02i", lv)..'-'..string.format("%02i", new)
  local out = os.date('%y')..'-'..string.format("%02i", lv)..'-'..string.format("%02i", new)
  return out
  return page
end
end


return p
return p

Version vom 15. Dezember 2020, 18:58 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
 local lv = tonumber(string.match(page, '%d+'))
 local out = os.date('%y')..'-'..string.format("%02i", lv)..'-'..string.format("%02i", new)
 return out
end

function p.next2(frame)
 frame = frame:getParent()
 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
 local lv = tonumber(string.match(page, '%d+'))
 local out = os.date('%y')..'-'..string.format("%02i", lv)..'-'..string.format("%02i", new)
 return page
end

return p