Module:Protection banner: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(format date output in the Blurb class) |
(use lang:formatDate instead of os.date as it is easier to localise) |
||
Line 187: | Line 187: | ||
function Blurb.formatDate(num) |
function Blurb.formatDate(num) |
||
-- Formats a Unix timestamp into dd M, YYYY format. |
-- Formats a Unix timestamp into dd M, YYYY format. |
||
lang = lang or mw.language.getContentLanguage() |
|||
local date = os.date('%e %B %Y', num) |
|||
local success, date = pcall( |
|||
-- The %e option replaces leading zeroes with spaces, but we don't want |
|||
lang.formatDate, |
|||
-- spaces. |
|||
lang, |
|||
date = date:gsub('^ ', '') |
|||
'j F Y', |
|||
⚫ | |||
'@' .. tostring(num) |
|||
) |
|||
if success then |
|||
⚫ | |||
end |
|||
end |
end |
||