Module:Protection banner/sandbox: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
makeCategoryLink should return nil rather than '' when there's no cat, to avoid unnecessary empty entries in the table, and it's never called without a sort key
Jackmcbarn (talk | contribs)
minor changes to validateDate
Line 32:
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
langif =not lang orthen
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
Line 41 ⟶ 43:
end
error(string.format(
'invalid %s: ("%s")',
dateType,
tostring(dateString)