Mô đun:Year category type
Giao diện
![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
local p = {}
local units = {
year = "^Năm %d*$",
year_bc = "^Năm %d* TCN$",
year_ad = "^AD %d*$",
decade = "^Thập niên %d*$",
decade_bc = "^Thập niên %d* TCN",
century = "^Thế kỷ %d*$",
century_bc = "^Thế kỷ %d* TCN$",
millennium = "^Thiên niên kỷ %d*$",
millennium_bc = "^Thiên niên kỷ %d* TCN$",
}
function p.main(frame)
local title = mw.title.getCurrentTitle().text
for unit, pattern in pairs(units) do
if string.match(title, pattern) then
return unit
end
end
return -1
end
return p