Open main menu

Changes

Module:Protection banner

14 bytes added, 11:55, 23 June 2014
use lang:formatDate instead of os.date as it is easier to localise
function Blurb.formatDate(num)
-- Formats a Unix timestamp into dd M, YYYY format.
local date lang = oslang or mw.datelanguage.getContentLanguage('%e %B %Y', num) -- The %e option replaces leading zeroes with spaceslocal success, but we don't wantdate = pcall( -- spaces lang.formatDate, lang, date = date:gsub( '^ j F Y', '@'.. tostring(num) ) if success then return date end
end
Anonymous user