Module:Catégorie par date
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local p = {}
function p.categorize(frame)
local args1 = frame:getParent().args
local args2 = frame.args
local dateparam = args1[1]
if (not dateparam) or dateparam == '' then return nil end
local prefix = args2.prefix
local suffix = args2.suffix
if prefix then prefix = prefix .. ' ' else prefix = '' end
if suffix then suffix = ' ' .. suffix else suffix = '' end
local default = args2.default or 'Échec de Module:Catégorie par date'
local datemin = tonumber(args2.datemin) or 2024
local datemax = tonumber(args2.datemax) or 2024
local catstring
for datenum = datemin,datemax do
local datestring = tostring(datenum)
if mw.ustring.find(dateparam,datestring) then
catstring = '[[Category:' .. prefix .. datestring .. suffix .. ']]'
return catstring
end
end
catstring = '[[Category:' .. default .. ']]'
return catstring
end
return p