2970
правок
(sync from sandbox; see talk;) |
Neotrit (обсуждение | вклад) м (1 версия импортирована) |
||
| (не показана 1 промежуточная версия этого же участника) | |||
| Строка 9: | Строка 9: | ||
['$aliases'] = 'parameter aliases', | ['$aliases'] = 'parameter aliases', | ||
['$flags'] = 'flags', | ['$flags'] = 'flags', | ||
['$ | ['$format'] = 'date format', | ||
['$ | ['$B'] = 'template content' | ||
} | } | ||
| Строка 48: | Строка 48: | ||
-- Find the invocation name. | -- Find the invocation name. | ||
local mTemplateInvocation = require('Module:Template invocation') | local mTemplateInvocation = require('Module:Template invocation') | ||
local | local name = mTemplateInvocation.name(frame:getParent():getTitle()) | ||
-- Combine passed args with passed defaults | -- Combine passed args with passed defaults | ||
local args = {} | local args = {} | ||
local format = frame.args['$format'] or 'j xg Y' | |||
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*override%s*,' ) then | if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*override%s*,' ) then | ||
for k, v in pairs( frame:getParent().args ) do | for k, v in pairs( frame:getParent().args ) do | ||
| Строка 65: | Строка 60: | ||
if not specialParams[k] then | if not specialParams[k] then | ||
if v == '__DATE__' then | if v == '__DATE__' then | ||
v = mw.getContentLanguage():formatDate( | v = mw.getContentLanguage():formatDate( format ) | ||
end | end | ||
args[k] = v | args[k] = v | ||
| Строка 74: | Строка 69: | ||
if not specialParams[k] then | if not specialParams[k] then | ||
if v == '__DATE__' then | if v == '__DATE__' then | ||
v = mw.getContentLanguage():formatDate( | v = mw.getContentLanguage():formatDate( format ) | ||
end | end | ||
args[k] = v | args[k] = v | ||