<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AYMD_to_ISO</id>
	<title>Module:YMD to ISO - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AYMD_to_ISO"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;action=history"/>
	<updated>2026-05-07T18:35:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=25794&amp;oldid=prev</id>
		<title>Richardpruen: 1 revision imported: Templates and CSS files</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=25794&amp;oldid=prev"/>
		<updated>2022-12-04T17:56:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Templates and CSS files&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:56, 4 December 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-25793:rev-25794 --&gt;
&lt;/table&gt;</summary>
		<author><name>Richardpruen</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=25793&amp;oldid=prev</id>
		<title>wikipedia&gt;Dinoguy1000: simplify month_number (instead of a separate test, `sept` can simply be added as an entry to the months_abbr array)</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=25793&amp;oldid=prev"/>
		<updated>2022-11-22T10:54:50Z</updated>

		<summary type="html">&lt;p&gt;simplify month_number (instead of a separate test, `sept` can simply be added as an entry to the months_abbr array)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:54, 22 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local function month_number(month_name)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;local function month_number(month_name)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local months_full = {january=1, february=2, march=3, april=4, may=5, june=6, july=7, august=8, september=9, october=10, november=11, december=12}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local months_full = {january=1, february=2, march=3, april=4, may=5, june=6, july=7, august=8, september=9, october=10, november=11, december=12}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local months_abbr = {jan=1, feb=2, mar=3, apr=4, may=5, jun=6, jul=7, aug=8, sep=9, oct=10, nov=11, dec=12}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local months_abbr = {jan=1, feb=2, mar=3, apr=4, may=5, jun=6, jul=7, aug=8, sep&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=9, sept&lt;/ins&gt;=9, oct=10, nov=11, dec=12}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local month_lc, _ = string.gsub(string.lower(month_name),&amp;#039;%.&amp;#039;,&amp;#039;&amp;#039;,1)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local month_lc, _ = string.gsub(string.lower(month_name),&amp;#039;%.&amp;#039;,&amp;#039;&amp;#039;,1)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local month_num = months_full[month_lc] or months_abbr[month_lc] or 0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     local month_num = months_full[month_lc] or months_abbr[month_lc] or 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    if month_lc == &#039;sept&#039; then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        month_num = 9&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return month_num&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return month_num&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>wikipedia&gt;Dinoguy1000</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=7603&amp;oldid=prev</id>
		<title>Richardpruen: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=7603&amp;oldid=prev"/>
		<updated>2021-09-01T14:35:39Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:35, 1 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-7602:rev-7603 --&gt;
&lt;/table&gt;</summary>
		<author><name>Richardpruen</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=7602&amp;oldid=prev</id>
		<title>Wikipedia&gt;El C: Protected &quot;Module:YMD to ISO&quot;: High-risk Lua module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:YMD_to_ISO&amp;diff=7602&amp;oldid=prev"/>
		<updated>2019-04-28T19:21:37Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/mediawiki/index.php/Module:YMD_to_ISO&quot; title=&quot;Module:YMD to ISO&quot;&gt;Module:YMD to ISO&lt;/a&gt;&amp;quot;: &lt;a href=&quot;/mediawiki/index.php?title=WP:High-risk_templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:High-risk templates (page does not exist)&quot;&gt;High-risk Lua module&lt;/a&gt; ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))&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;
&lt;br /&gt;
local function month_number(month_name)&lt;br /&gt;
    local months_full = {january=1, february=2, march=3, april=4, may=5, june=6, july=7, august=8, september=9, october=10, november=11, december=12}&lt;br /&gt;
    local months_abbr = {jan=1, feb=2, mar=3, apr=4, may=5, jun=6, jul=7, aug=8, sep=9, oct=10, nov=11, dec=12}&lt;br /&gt;
    local month_lc, _ = string.gsub(string.lower(month_name),&amp;#039;%.&amp;#039;,&amp;#039;&amp;#039;,1)&lt;br /&gt;
    local month_num = months_full[month_lc] or months_abbr[month_lc] or 0&lt;br /&gt;
    if month_lc == &amp;#039;sept&amp;#039; then&lt;br /&gt;
        month_num = 9&lt;br /&gt;
    end&lt;br /&gt;
    return month_num&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function days_in_month(month_num,year)&lt;br /&gt;
    -- modified from code in Module:Citation/CS1/Date_validation&lt;br /&gt;
    local days = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}&lt;br /&gt;
    local month_length&lt;br /&gt;
    if month_num == 2 then         -- February: 28 days, unless leap year&lt;br /&gt;
        month_length = 28&lt;br /&gt;
        if year &amp;lt;= 1582 then       -- Julian calendar before Oct 1582&lt;br /&gt;
            if (year%4) == 0 then&lt;br /&gt;
                month_length = 29  -- if leap year, then 29 days&lt;br /&gt;
            end&lt;br /&gt;
        else                       -- Gregorian calendar since Oct 1582&lt;br /&gt;
            if ( (year%4)==0 and ((year%100)~=0 or (year%400)==0) ) then  &lt;br /&gt;
                month_length = 29  -- if leap year, then 29 days   &lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else                           -- not February, get number of days for month&lt;br /&gt;
        month_length = days[month_num]&lt;br /&gt;
    end&lt;br /&gt;
    return month_length&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function zero_pad(string)&lt;br /&gt;
    if string.len(string) == 1 then&lt;br /&gt;
        return &amp;#039;0&amp;#039; .. string&lt;br /&gt;
    else&lt;br /&gt;
        return string&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    if frame.args[1] == nil then&lt;br /&gt;
        return &amp;#039;&amp;#039;     -- first argument is missing&lt;br /&gt;
    end&lt;br /&gt;
    local arg1, _ = string.gsub(mw.text.trim(frame.args[1]),&amp;#039;_&amp;#039;,&amp;#039; &amp;#039;)&lt;br /&gt;
    return p._main(arg1)&lt;br /&gt;
end&lt;br /&gt;
function p._main(arg1)&lt;br /&gt;
    if arg1 == &amp;#039;&amp;#039; then&lt;br /&gt;
        return &amp;#039;&amp;#039;     -- first argument is empty&lt;br /&gt;
    end&lt;br /&gt;
    if not arg1:match(&amp;#039;^%d%d%d%d %a%a%a%a?%.?%a?%a?%a?%a?%a?%a? *%d%d?$&amp;#039;) then&lt;br /&gt;
        return arg1   -- invalid date pattern&lt;br /&gt;
    end&lt;br /&gt;
    local year, month_name, day = string.match(arg1, &amp;#039;^(%d%d%d%d) *(%a%a%a%a?%.?%a?%a?%a?%a?%a?%a?) *(%d%d?)$&amp;#039;)&lt;br /&gt;
    if month_number(month_name) == 0 then&lt;br /&gt;
        return arg1   -- invalid month name or abbreviation&lt;br /&gt;
    end&lt;br /&gt;
    if tonumber(day) &amp;lt; 1 or tonumber(day) &amp;gt; days_in_month(month_number(month_name),tonumber(year)) then&lt;br /&gt;
        return arg1   -- invalid day number for given month&lt;br /&gt;
    end&lt;br /&gt;
    return year .. &amp;#039;-&amp;#039; .. zero_pad(tostring(month_number(month_name))) .. &amp;#039;-&amp;#039; .. zero_pad(day)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;El C</name></author>
	</entry>
</feed>