Modul:Protection banner: Unterschied zwischen den Versionen
turn Blurb.formatDate into Blurb:_formatDate so that it can access the config
(get the expiry date format from a config message) |
(turn Blurb.formatDate into Blurb:_formatDate so that it can access the config) |
||
Zeile 350: | Zeile 350: | ||
end | end | ||
-- | -- Private methods -- | ||
function Blurb | function Blurb:_formatDate(num) | ||
-- Formats a Unix timestamp into dd Month, YYYY format. | -- Formats a Unix timestamp into dd Month, YYYY format. | ||
lang = lang or mw.language.getContentLanguage() | lang = lang or mw.language.getContentLanguage() | ||
Zeile 365: | Zeile 365: | ||
end | end | ||
end | end | ||
function Blurb:_getExpandedMessage(msgKey) | function Blurb:_getExpandedMessage(msgKey) | ||
Zeile 464: | Zeile 462: | ||
local expiry = self._protectionObj.expiry | local expiry = self._protectionObj.expiry | ||
if type(expiry) == 'number' then | if type(expiry) == 'number' then | ||
return | return self:_formatDate(expiry) | ||
else | else | ||
return expiry | return expiry | ||
Zeile 545: | Zeile 543: | ||
local protectionDate = self._protectionObj.protectionDate | local protectionDate = self._protectionObj.protectionDate | ||
if type(protectionDate) == 'number' then | if type(protectionDate) == 'number' then | ||
return | return self:_formatDate(protectionDate) | ||
else | else | ||
return protectionDate | return protectionDate |