<?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%3AInterval</id>
	<title>Module:Interval - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AInterval"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Interval&amp;action=history"/>
	<updated>2026-04-16T21:23:16Z</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:Interval&amp;diff=137033&amp;oldid=prev</id>
		<title>imported&gt;Anomie: Changed protection level for &quot;Module:Interval&quot;: Syncing protection from formerly cascade-protected Template:ACEWatchlistNotice ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Interval&amp;diff=137033&amp;oldid=prev"/>
		<updated>2018-11-29T01:11:27Z</updated>

		<summary type="html">&lt;p&gt;Changed protection level for &amp;quot;&lt;a href=&quot;/research/Module:Interval&quot; title=&quot;Module:Interval&quot;&gt;Module:Interval&lt;/a&gt;&amp;quot;: Syncing protection from formerly cascade-protected &lt;a href=&quot;/index.php?title=Template:ACEWatchlistNotice&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:ACEWatchlistNotice (page does not exist)&quot;&gt;Template:ACEWatchlistNotice&lt;/a&gt; ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module powers {{interval}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Constants&lt;br /&gt;
local lang = mw.language.getContentLanguage()&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local function getArgNums(args)&lt;br /&gt;
    -- Returns an array containing the keys of all positional arguments&lt;br /&gt;
    -- that contain data (i.e. non-whitespace values).&lt;br /&gt;
    -- (from Module:Unbulleted_list)&lt;br /&gt;
    local nums = {}&lt;br /&gt;
    for k, v in pairs(args) do&lt;br /&gt;
        if type(k) == &amp;#039;number&amp;#039; and&lt;br /&gt;
            k &amp;gt;= 1 and&lt;br /&gt;
            math.floor(k) == k and&lt;br /&gt;
            mw.ustring.match(v, &amp;#039;%S&amp;#039;) then&lt;br /&gt;
                table.insert(nums, k)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    table.sort(nums)&lt;br /&gt;
    return nums&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local args = getArgs(frame)&lt;br /&gt;
    return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
    local n, rule, format = args.n, args.rule, args.format&lt;br /&gt;
    local numbers = getArgNums(args)&lt;br /&gt;
    local low, high, lowpos, highpos = nil, nil, 0, #numbers + 1&lt;br /&gt;
&lt;br /&gt;
    -- If comparing times, convert them all to seconds after the epoch&lt;br /&gt;
    if format == &amp;#039;time&amp;#039; then&lt;br /&gt;
        if n then&lt;br /&gt;
            n = lang:formatDate(&amp;#039;U&amp;#039;, &amp;#039;@&amp;#039; .. n)&lt;br /&gt;
        else&lt;br /&gt;
            n = os.time() -- Set n to now if no time provided&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    n = tonumber(n)&lt;br /&gt;
&lt;br /&gt;
    for i, num in ipairs(numbers) do&lt;br /&gt;
        local interval&lt;br /&gt;
        if format == &amp;#039;time&amp;#039; then&lt;br /&gt;
            interval = tonumber(lang:formatDate(&amp;#039;U&amp;#039;, &amp;#039;@&amp;#039; .. args[num]))&lt;br /&gt;
        else&lt;br /&gt;
            interval = tonumber(args[num])&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        if n and ((n &amp;gt;= interval and not rule) or (n &amp;gt; interval and rule == &amp;#039;&amp;gt;&amp;#039;)) then&lt;br /&gt;
            low = interval&lt;br /&gt;
            lowpos = num&lt;br /&gt;
        else&lt;br /&gt;
            high = high and math.min(interval, high) or interval&lt;br /&gt;
            if high == interval then highpos = num end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return lowpos .. &amp;#039;-&amp;#039; .. highpos&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Anomie</name></author>
	</entry>
</feed>