Изменения
Перейти к навигации
Перейти к поиску
Строка 9:
Строка 9:
− +
− +
Строка 48:
Строка 48:
− +
+
+
+
+
+
+
− local format = frame.args['$format'] or 'j xg Y'
Строка 60:
Строка 65:
− +
Строка 69:
Строка 74:
− +
sync from sandbox; see talk;
['$aliases'] = 'parameter aliases',
['$aliases'] = 'parameter aliases',
['$flags'] = 'flags',
['$flags'] = 'flags',
['$format'] = 'date format',
['$B'] = 'template content',
['$B'] = 'template content'
['$template-name'] = 'template invocation name override',
}
}
-- Find the invocation name.
-- Find the invocation name.
local mTemplateInvocation = require('Module:Template invocation')
local mTemplateInvocation = require('Module:Template invocation')
local name = mTemplateInvocation.name(frame:getParent():getTitle())
local name
if frame.args['$template-name'] and '' ~= frame.args['$template-name'] then
name = frame.args['$template-name'] -- override whatever the template name is with this name
else
name = mTemplateInvocation.name(frame:getParent():getTitle())
end
-- Combine passed args with passed defaults
-- Combine passed args with passed defaults
local args = {}
local args = {}
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
if not specialParams[k] then
if not specialParams[k] then
if v == '__DATE__' then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( format )
v = mw.getContentLanguage():formatDate( 'F Y' )
end
end
args[k] = v
args[k] = v
if not specialParams[k] then
if not specialParams[k] then
if v == '__DATE__' then
if v == '__DATE__' then
v = mw.getContentLanguage():formatDate( format )
v = mw.getContentLanguage():formatDate( 'F Y' )
end
end
args[k] = v
args[k] = v