Module:Category described in year: Difference between revisions

Content deleted Content added
+currYearSortkey = last 2 digits of year (see Category:Fish described in the 20th century)
m Undid revision 840835810 by Tom.Reding (talk) Not as useful as I had hoped
Line 17:
['min'] = 1758, --integer; lowest possible year displayed in nav bars; default to 1758 per ICZN Art. 5
['year'] = { --[[Category:Fish described in 1901]]
['description'] = '', --'Description tbd; year; This category should only contain species-level articles, etc....',
['parent1'] = 'century', --year/decade/century/formal, i.e. 'century' for [[Category:Fish described in the 20th century]]
['parent2'] = 'Animals', --[[Category:Animals described in the 20th century]]
Line 87:
local currGroup = mw.ustring.match(currCat, '^%w+') --Fish/Spiders/default/etc.
if map[currGroup] == nil then map[currGroup] = map['Fish'] end --'Fish' == default
local currYDC = nil --placeholder for year/decade/century
local currYearSortkey = nil --'Fish described in 20th century|currYearSortkey' in 'Fish described in YYYY' type cats
local currYear = mw.ustring.match(currCat, 'in (%d%d%d%d)$')
local currDeca = mw.ustring.match(currCat, 'the (%d%d%d%d)s$')
Line 99 ⟶ 98:
if currYear then
currYDC = 'year'
currYearSortkey = mw.ustring.match(currCat, 'in %d%d(%d%d)$')
parentDeca = mw.ustring.match(currYear, '^(%d%d%d)%d$') .. '0'
if mw.ustring.match(currYear, '^%d%d00') then --1900 in 19th century
Line 135 ⟶ 133:
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. parentDeca .. 's]]'
elseif parent == 'century' then
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. addOrd(parentCent) .. ' century|' .. currYearSortkey .. ']]'
else --i.e. Animals; require capital first letter?
categories[iparent] = '[[Category:' .. parent .. ' described in ' .. currYear .. ']]'