Khác biệt giữa bản sửa đổi của “Mô đun:Thử”

Nội dung được xóa Nội dung được thêm vào
Không có tóm lược sửa đổi
Thẻ: Đã bị lùi lại
Không có tóm lược sửa đổi
Thẻ: Đã bị lùi lại
Dòng 1:
local yesno = require('ModuleMô đun:Yesno')
local lang = mw.language.getContentLanguage()
local N_YEAR_DIGITS = 12
Dòng 242:
if bc then
local bcLower = type(bc) == 'string' and bc:lower()
if bcLower == 'bc' or bcLower == 'bce' or bcLower == 'tcn' then
if self.year and self.year > 0 then
self.year = -self.year
end
elseif bcLower ~= 'ad' and bcLower ~= 'ce' and bclower ~= 'scn' then
error(string.format(
"'%s' is not a valid era code (expected 'BC', 'BCE', 'AD' or, 'CE', 'TCN' and 'SCN')",
tostring(bc)
), 0)
Dòng 442:
local hasMonth = self.month and self.format:find('m')
local hasDay = self.day and self.format:find('d')
 
local isMonthFirst = self.format:find('md')
local ret = {}
if hasDay and hasMonth and isMonthFirst then
ret[#ret + 1] = self:getMonthName()
ret[#ret + 1] = self.day .. ' ' .. self:getMonthName()
ret[#ret + 1] = self.day
if hasYear then
ret[#ret + 1] = ','
end
elseif hasDay and hasMonth then
ret[#ret + 1] = self.day
ret[#ret + 1] = ' '
ret[#ret + 1] = self:getMonthName()
elseif hasDay then
ret[#ret + 1] = self.day
Hàng 462 ⟶ 454:
if hasYear then
if hasDay or hasMonth then
ret[#ret + 1] = '  năm '
end
local displayYear = math.abs(self.year)
Hàng 472 ⟶ 464:
ret[#ret + 1] = displayYear
if self.year < 0 then
ret[#ret + 1] = '&nbsp;BCTCN'
end
end
return table.concat(ret)
end
 
function Dts:renderTrackingCategories()
if self.hasDeprecatedParameters then
return '[[Thể loại:Dts templates with deprecated parameters]]'
else
return ''
end
end
 
Dòng 515:
else
ret = string.format(
'<strong class="error">ErrorLỗi introng [[TemplateBản mẫu:Date table sortingDts]]: %s</strong>',
ret
)
if mw.title.getCurrentTitle().namespace == 0 then
-- Only categorise in the main namespace
ret = ret .. '[[CategoryThể loại:DateBản tablemẫu sortingDts templatesvới withcác errorslỗi]]'
end
return ret
Dòng 527:
 
function p.main(frame)
local args = require('ModuleMô đun:Arguments').getArgs(frame, {)
wrappers = 'Template:Date table sorting',
})
return p._main(args)
end