模块:Message box:修订间差异
imported>Quest for Truth 无编辑摘要 |
imported>Quest for Truth 无编辑摘要 |
||
| 第343行: | 第343行: | ||
-- The following is roughly equivalent to the old {{Ambox/category}}. | -- The following is roughly equivalent to the old {{Ambox/category}}. | ||
local date | local date | ||
local sortDay | |||
if args.date and args.date ~= '' then | if args.date and args.date ~= '' then | ||
date = args.date | date = args.date | ||
elseif args.time and args.time ~= '' then | elseif args.time and args.time ~= '' then | ||
date = lang:formatDate('Y年n月', time) | date = lang:formatDate('Y年n月', time) | ||
sortDay = lang:formatDate('j', time) | |||
end | end | ||
date = type(date) == 'string' and date | date = type(date) == 'string' and date | ||
| 第357行: | 第359行: | ||
if mainCat and date and date ~= '' then | if mainCat and date and date ~= '' then | ||
local catTitle = format('%s%s%s', preposition, date, mainCat) | local catTitle = format('%s%s%s', preposition, date, mainCat) | ||
self:addCat('main', catTitle) | if sortDay then | ||
self:addCat('main', catTitle, sortDay) | |||
else | |||
self:addCat('main', catTitle) | |||
end | |||
catTitle = getTitleObject('Category:' .. catTitle) | catTitle = getTitleObject('Category:' .. catTitle) | ||
if not catTitle or not catTitle.exists then | if not catTitle or not catTitle.exists then | ||