<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ANavseasoncats_with_centuries_below_decade</id>
	<title>Module:Navseasoncats with centuries below decade - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ANavseasoncats_with_centuries_below_decade"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Navseasoncats_with_centuries_below_decade&amp;action=history"/>
	<updated>2026-06-23T07:23:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Navseasoncats_with_centuries_below_decade&amp;diff=478802&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Navseasoncats_with_centuries_below_decade&amp;diff=478802&amp;oldid=prev"/>
		<updated>2021-07-16T05:11:44Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local nsc = require('Module:Navseasoncats')&lt;br /&gt;
&lt;br /&gt;
function p.cbd( frame )&lt;br /&gt;
	local currtitle = mw.title.getCurrentTitle()&lt;br /&gt;
	local testcases = (currtitle.subpageText == 'testcases')&lt;br /&gt;
	local avoidself =  (currtitle.text ~= 'Navseasoncats with centuries below decade' and          --avoid self&lt;br /&gt;
						currtitle.text ~= 'Navseasoncats with centuries below decade/doc' and      --avoid self&lt;br /&gt;
						currtitle.text ~= 'Navseasoncats with centuries below decade/sandbox' and  --avoid self&lt;br /&gt;
						(currtitle.nsText ~= 'Template' or testcases)) --avoid nested transclusion errors&lt;br /&gt;
	&lt;br /&gt;
	local testcase = frame:getParent().args[1]&lt;br /&gt;
	if testcase == nil and avoidself == false then return '' end&lt;br /&gt;
	&lt;br /&gt;
	local pagename = testcase or currtitle.baseText&lt;br /&gt;
	local findvar = nsc.find_var(pagename) --picks up decades/seasons/etc.&lt;br /&gt;
	if findvar[1] == 'error' then&lt;br /&gt;
		local errorout = ''&lt;br /&gt;
		if avoidself then&lt;br /&gt;
			local errors = nsc.errorclass('Function find_var can\'t recognize the decade for category &amp;quot;'..pagename..'&amp;quot;.')&lt;br /&gt;
			errorout = nsc.failedcat(errors, 'P')&lt;br /&gt;
			if testcases then string.gsub(errorout, '(%[%[)(Category)', '%1:%2') end&lt;br /&gt;
		end&lt;br /&gt;
		return errorout&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local decade = tonumber(string.match(findvar[2], '^(%d+)s'))&lt;br /&gt;
	if decade == nil or findvar[1] ~= 'decade' then&lt;br /&gt;
		local errorout = ''&lt;br /&gt;
		if avoidself then&lt;br /&gt;
			local errors = nsc.errorclass('{{Navseasoncats with centuries below decade}} can\'t recognize the decade for category &amp;quot;'..pagename..'&amp;quot;.')&lt;br /&gt;
			errorout = nsc.failedcat(errors, 'P')&lt;br /&gt;
			if testcases then string.gsub(errorout, '(%[%[)(Category)', '%1:%2') end&lt;br /&gt;
		end&lt;br /&gt;
		return errorout&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local firstpart, lastpart = string.match(pagename, '^(.*)'..findvar[2]..'(.*)$')&lt;br /&gt;
	firstpart = mw.text.trim(firstpart or '')&lt;br /&gt;
	lastpart  = mw.text.trim(lastpart or '')&lt;br /&gt;
	&lt;br /&gt;
	local nav1 = ''&lt;br /&gt;
	if testcase then&lt;br /&gt;
		local args = { testcase = testcase }&lt;br /&gt;
		nav1 = frame:expandTemplate{ title = 'Navseasoncats', args = args } --not sure how else to pass frame &amp;amp; args together&lt;br /&gt;
	else&lt;br /&gt;
		nav1 = nsc.navseasoncats(frame)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local century = math.floor( ((decade-1)/100) + 1 ) --from {{CENTURY}}&lt;br /&gt;
	if string.match(decade, '00$') then century = century + 1 end --'2000' is technically in the 20th, but the rest of the 2000s is in the 21st&lt;br /&gt;
	&lt;br /&gt;
	local centurycat = mw.text.trim( firstpart..' '..nsc.addord(century)..' century '..lastpart )&lt;br /&gt;
	local exists = mw.title.new( centurycat, 'Category' ).exists&lt;br /&gt;
	&lt;br /&gt;
	if not exists then --check for hyphenated century&lt;br /&gt;
		centurycat = mw.text.trim( firstpart..' '..nsc.addord(century)..'-century '..lastpart )&lt;br /&gt;
		exists = mw.title.new( centurycat, 'Category' ).exists&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if exists then&lt;br /&gt;
		local args = { ['century-below-decade'] = centurycat }&lt;br /&gt;
		local nav2 = frame:expandTemplate{ title = 'Navseasoncats', args = args } --not sure how else to pass frame &amp;amp; args together&lt;br /&gt;
		return '&amp;lt;div style=&amp;quot;display:block !important; max-width: calc(100% - 25em);&amp;quot;&amp;gt;' ..&amp;quot;\n&amp;quot; .. nav1..nav2 ..&amp;quot;\n&amp;quot; .. '&amp;lt;/div&amp;gt;'&lt;br /&gt;
	else&lt;br /&gt;
		return nav1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>