Module:Protection banner: Difference between revisions
use lang:formatDate instead of os.date as it is easier to localise
(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 success, date = pcall( | |||
lang.formatDate, | |||
lang, | |||
return date | 'j F Y', | ||
'@' .. tostring(num) | |||
) | |||
if success then | |||
return date | |||
end | |||
end | end | ||