<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ADating</id>
	<title>Module:Dating - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ADating"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Dating&amp;action=history"/>
	<updated>2026-04-04T10:29:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Dating&amp;diff=135957&amp;oldid=prev</id>
		<title>223.179.196.123 at 18:43, 29 December 2017</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Dating&amp;diff=135957&amp;oldid=prev"/>
		<updated>2017-12-29T18:43:11Z</updated>

		<summary type="html">&lt;p&gt;&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;
	function p.Dates (frame)&lt;br /&gt;
		local input = mw.text.trim(frame.args[1]) or 0&lt;br /&gt;
		if input ~= 0 then&lt;br /&gt;
			input = &amp;quot; &amp;quot; .. input .. &amp;quot; &amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		local xformat = frame.args.format or 0&lt;br /&gt;
		local xsuffix = frame.args.suffix or 0&lt;br /&gt;
		local sSuffix = 0&lt;br /&gt;
		local valid&lt;br /&gt;
		if input ~= 0 then valid = 1 else valid = 0 end&lt;br /&gt;
		local mnths = {}&lt;br /&gt;
		local yrs = {}&lt;br /&gt;
		local dts = {}&lt;br /&gt;
		local i = 1 &lt;br /&gt;
		local j = 1&lt;br /&gt;
		local k = 1&lt;br /&gt;
		local valid = 1&lt;br /&gt;
		local ly = 0&lt;br /&gt;
		local txt = &amp;quot;&amp;quot;&lt;br /&gt;
		local nums = {}&lt;br /&gt;
		local m = 1&lt;br /&gt;
		local Months = {&lt;br /&gt;
						&amp;quot;January&amp;quot;,&lt;br /&gt;
						&amp;quot;February&amp;quot;,&lt;br /&gt;
						&amp;quot;March&amp;quot;,&lt;br /&gt;
						&amp;quot;April&amp;quot;,&lt;br /&gt;
						&amp;quot;May&amp;quot;,&lt;br /&gt;
						&amp;quot;June&amp;quot;,&lt;br /&gt;
						&amp;quot;July&amp;quot;,&lt;br /&gt;
						&amp;quot;August&amp;quot;,&lt;br /&gt;
						&amp;quot;September&amp;quot;,&lt;br /&gt;
						&amp;quot;October&amp;quot;,&lt;br /&gt;
						&amp;quot;November&amp;quot;,&lt;br /&gt;
						&amp;quot;December&amp;quot;&lt;br /&gt;
			           }&lt;br /&gt;
		for data in string.gmatch (input, &amp;quot;%w+&amp;quot;) do&lt;br /&gt;
			data = &amp;quot; &amp;quot; .. data .. &amp;quot; &amp;quot;&lt;br /&gt;
			if data:find (&amp;quot;%s%d%a%a%s&amp;quot;) then&lt;br /&gt;
				if tonumber(string.sub(data, 2, 2)) &amp;lt; 32 then&lt;br /&gt;
					dts[i] = tonumber(string.sub(data, 2, 2))&lt;br /&gt;
					i = i + 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if data:find (&amp;quot;%s%d%d%a%a%s&amp;quot;) then&lt;br /&gt;
				if tonumber(string.sub(data, 2, 3)) &amp;lt; 32 then&lt;br /&gt;
					dts[i] = tonumber(string.sub(data, 2, 3))&lt;br /&gt;
					i = i + 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if input:find (&amp;quot;%s%d%d%d%d%s&amp;quot;) then&lt;br /&gt;
			yrs[k] = tonumber(string.sub(input, input:find (&amp;quot;%s%d%d%d%d%s&amp;quot;)+1,  input:find (&amp;quot;%s%d%d%d%d%s&amp;quot;)+4))&lt;br /&gt;
			k = k + 1&lt;br /&gt;
		end&lt;br /&gt;
		for l = 1, 12 do&lt;br /&gt;
			if input:find(string.sub(Months[l], 1, 3)) or input:find(string.lower(string.sub(Months[l], 1, 3))) then&lt;br /&gt;
				mnths[j] = l&lt;br /&gt;
				j = j + 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		for data in string.gmatch (input, &amp;quot;%d+&amp;quot;) do&lt;br /&gt;
			data = tonumber(data)&lt;br /&gt;
			if data &amp;gt; 31 then&lt;br /&gt;
				yrs[k] = data&lt;br /&gt;
				k = k + 1&lt;br /&gt;
			else&lt;br /&gt;
				if data &amp;gt; 12 then&lt;br /&gt;
					if #dts == 0 then&lt;br /&gt;
						dts[i] = data&lt;br /&gt;
						i = i + 1&lt;br /&gt;
					else&lt;br /&gt;
						nums[m] = data&lt;br /&gt;
						m = m + 1&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					nums[m] = data&lt;br /&gt;
					m = m + 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		for l = 1, 3 do&lt;br /&gt;
			if nums[l] then&lt;br /&gt;
				if #dts == 0 then&lt;br /&gt;
					dts [i] = nums[l] &lt;br /&gt;
					i = i + 1&lt;br /&gt;
				else &lt;br /&gt;
					if #mnths == 0 then&lt;br /&gt;
						mnths [j] = nums[l]&lt;br /&gt;
						j = j + 1&lt;br /&gt;
					else&lt;br /&gt;
						if #yrs == 0 then&lt;br /&gt;
							yrs[k] = nums[l]&lt;br /&gt;
							k = k + 1&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		local date = dts[1] or 0&lt;br /&gt;
		local month = mnths[1] or 0&lt;br /&gt;
		local year = yrs[1] or 0&lt;br /&gt;
		if xformat == 0 then &lt;br /&gt;
			if input:find (&amp;quot;/&amp;quot;) or input:find (&amp;quot;-&amp;quot;) then&lt;br /&gt;
				xformat = &amp;quot;iso&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				if input:find (&amp;quot;, &amp;quot;) then&lt;br /&gt;
					xformat = &amp;quot;mdy&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					xformat = &amp;quot;dmy&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if date ~= 0 and year ~= 0 and month == 0 then&lt;br /&gt;
				xformat = &amp;quot;year&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if date == 0 and year ~= 0 and month == 0 then&lt;br /&gt;
				xformat = &amp;quot;year&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if input:find (&amp;quot;uncertain&amp;quot;) or input:find(&amp;quot;around&amp;quot;) or input:find(&amp;quot;sometime&amp;quot;) then&lt;br /&gt;
			if input:find (&amp;quot;uncertain who&amp;quot;) then&lt;br /&gt;
				sSuffix = 2&lt;br /&gt;
			else&lt;br /&gt;
				sSuffix = 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if xsuffix == 0 then &lt;br /&gt;
			if input:find (&amp;quot;year&amp;quot;) and input:find (&amp;quot;lord&amp;quot;) then	xsuffix = &amp;quot;AD&amp;quot; 	end&lt;br /&gt;
			if input:find (&amp;quot;AD&amp;quot;) then xsuffix = &amp;quot;AD&amp;quot; end&lt;br /&gt;
			if input:find (&amp;quot;BC&amp;quot;) then xsuffix = &amp;quot;BC&amp;quot; end&lt;br /&gt;
			if input:find (&amp;quot;CE&amp;quot;) then xsuffix = &amp;quot;CE&amp;quot; end&lt;br /&gt;
			if input:find (&amp;quot;BCE&amp;quot;) then xsuffix = &amp;quot;BCE&amp;quot; end&lt;br /&gt;
		end&lt;br /&gt;
		if xsuffix ~= 0 then&lt;br /&gt;
			if year == 0 then&lt;br /&gt;
				if date ~= 0 and month ~= 0 then else&lt;br /&gt;
					if date ~= 0 then &lt;br /&gt;
						year = date&lt;br /&gt;
						xformat = &amp;quot;year&amp;quot;&lt;br /&gt;
						date = 0&lt;br /&gt;
					end&lt;br /&gt;
					if month ~= 0 then&lt;br /&gt;
						year = month&lt;br /&gt;
						xforamt = &amp;quot;year&amp;quot;&lt;br /&gt;
						month = 0&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if date ~= 0 and year == 0 and month == 0 then valid = 0 end&lt;br /&gt;
		if month == 4 or month == 6 or month == 9 or month == 11 then &lt;br /&gt;
			if date &amp;gt; 30 then&lt;br /&gt;
				valid = 0&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if year % 100 ~= 0 and year % 4 == 0 then&lt;br /&gt;
			ly = 1&lt;br /&gt;
		else&lt;br /&gt;
			if year % 400 == 0 then&lt;br /&gt;
				ly = 1&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if month == 2 then&lt;br /&gt;
			if ly == 1 then&lt;br /&gt;
				if date &amp;gt; 29 then&lt;br /&gt;
					valid = 0&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				if date &amp;gt; 28 then&lt;br /&gt;
					valid = 0 &lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if date == 0 and month == 0 and year == 0 then valid = 0 end&lt;br /&gt;
		if year == 0 then&lt;br /&gt;
			for l = 1, 12 do&lt;br /&gt;
				if input:find(string.sub(Months[l], 1, 3)) or input:find(string.lower(string.sub(Months[l], 1, 3))) then&lt;br /&gt;
					valid = 1&lt;br /&gt;
					break&lt;br /&gt;
				else&lt;br /&gt;
					valid = 0&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if valid == 0 then txt = &amp;quot;Invalid entry. &amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			if xformat == &amp;quot;iso&amp;quot; then&lt;br /&gt;
				if year ~= 0 then &lt;br /&gt;
					txt = txt .. year&lt;br /&gt;
				end&lt;br /&gt;
				if month ~= 0 then&lt;br /&gt;
					if month &amp;gt; 10 then&lt;br /&gt;
						txt = txt .. &amp;quot;-&amp;quot; .. month&lt;br /&gt;
					else&lt;br /&gt;
						month = &amp;quot;0&amp;quot; .. month&lt;br /&gt;
						txt = txt .. &amp;quot;-&amp;quot; .. month&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				if date ~= 0 then&lt;br /&gt;
					if date &amp;gt; 10 then&lt;br /&gt;
						txt = txt .. &amp;quot;-&amp;quot; .. date&lt;br /&gt;
					else&lt;br /&gt;
						date = &amp;quot;0&amp;quot; .. date&lt;br /&gt;
						txt = txt .. &amp;quot;-&amp;quot; .. date&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if xformat == &amp;quot;dmy&amp;quot; then&lt;br /&gt;
				if date ~= 0 then&lt;br /&gt;
					txt = txt .. date&lt;br /&gt;
				end&lt;br /&gt;
				if month ~= 0 then&lt;br /&gt;
					txt = txt .. &amp;quot; &amp;quot; .. Months[month]&lt;br /&gt;
				end&lt;br /&gt;
				if year ~= 0 then &lt;br /&gt;
					txt = txt .. &amp;quot; &amp;quot; .. year&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if xformat == &amp;quot;mdy&amp;quot; then&lt;br /&gt;
				if month ~= 0 then&lt;br /&gt;
					txt = txt .. Months[month]&lt;br /&gt;
				end&lt;br /&gt;
				if date ~= 0 then&lt;br /&gt;
					txt = txt .. &amp;quot; &amp;quot; .. date  &lt;br /&gt;
				end&lt;br /&gt;
				if year ~= 0 then &lt;br /&gt;
					txt = txt .. &amp;quot;, &amp;quot; .. year&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if xformat == &amp;quot;year&amp;quot; then &lt;br /&gt;
				if year ~= 0 then&lt;br /&gt;
					txt = txt .. year&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if xsuffix ~= 0 then&lt;br /&gt;
				txt = txt .. &amp;quot; &amp;quot; .. xsuffix&lt;br /&gt;
			end&lt;br /&gt;
			if sSuffix ~= 0 then&lt;br /&gt;
				if sSuffix == 1 then&lt;br /&gt;
					txt = &amp;quot;c. &amp;quot; .. txt&lt;br /&gt;
				end&lt;br /&gt;
				if sSuffix == 2 then&lt;br /&gt;
					txt = txt .. &amp;quot; (uncertain who was present)&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return txt .. &amp;quot; &amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>223.179.196.123</name></author>
	</entry>
</feed>