יחידה:ParamValidator: הבדלים בין גרסאות בדף
מ שחזור עקב בעית lua |
|||
| שורה 102: | שורה 102: | ||
function calculateViolations( frame, subpages ) | function calculateViolations( frame, subpages ) | ||
-- used for parameter type validy test. add "isDate", "isWikicode" etc. | |||
function isNumber( s ) mw.language.getCurrentLanguage():parseNumber( s ) end | |||
function compatible( val, typ ) | function compatible( val, typ ) | ||
if typ == 'number' | if not typ or util.empty( val ) then return true | ||
elseif typ == 'number' then return isNumber( val ) | |||
-- elseif typ == 'date' then return isDate( val ) etc. etc. etc. | |||
end | |||
return true | return true | ||
end | end | ||