<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.endmyopia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ACountdown</id>
	<title>Module:Countdown - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.endmyopia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ACountdown"/>
	<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;action=history"/>
	<updated>2026-05-02T05:10:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=6738&amp;oldid=prev</id>
		<title>NottNott at 10:39, 7 June 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=6738&amp;oldid=prev"/>
		<updated>2020-06-07T10:39:47Z</updated>

		<summary type="html">&lt;p&gt;&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&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 10:39, 7 June 2020&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-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&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;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;	-- Color and bold the numbers, because it makes them look important.&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;	-- Color and bold the numbers, because it makes them look important.&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;	timeLeft = string.gsub(timeLeft, '(%d+)', '&amp;lt;span style=&amp;quot;color: ' .. (color or '#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;F00&lt;/del&gt;') .. '; font-weight: bold;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;')&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;	timeLeft = string.gsub(timeLeft, '(%d+)', '&amp;lt;span style=&amp;quot;color: ' .. (color or '#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;000&lt;/ins&gt;') .. '; font-weight: bold;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;')&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;	return string.format('There %s %s until %s.', isOrAre, timeLeft, event)&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 string.format('There %s %s until %s.', isOrAre, timeLeft, event)&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;!-- diff cache key jakeendmy_mw1720-mwnr_:diff::1.12:old-5011:rev-6738 --&gt;
&lt;/table&gt;</summary>
		<author><name>NottNott</name></author>
	</entry>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=5011&amp;oldid=prev</id>
		<title>NottNott: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=5011&amp;oldid=prev"/>
		<updated>2020-05-30T20:43:07Z</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&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 20:43, 30 May 2020&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key jakeendmy_mw1720-mwnr_:diff::1.12:old-5010:rev-5011 --&gt;
&lt;/table&gt;</summary>
		<author><name>NottNott</name></author>
	</entry>
	<entry>
		<id>https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=5010&amp;oldid=prev</id>
		<title>en&gt;Johnuniq: fix problem mentioned at Template talk:Countdown#Problem in module with parentheses (module does not show a current event as in progress) + new parameter |refresh=no per request at talk</title>
		<link rel="alternate" type="text/html" href="https://wiki.endmyopia.org/index.php?title=Module:Countdown&amp;diff=5010&amp;oldid=prev"/>
		<updated>2019-04-02T06:23:19Z</updated>

		<summary type="html">&lt;p&gt;fix problem mentioned at &lt;a href=&quot;/index.php?title=Template_talk:Countdown&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template talk:Countdown (page does not exist)&quot;&gt;Template talk:Countdown#Problem in module with parentheses&lt;/a&gt; (module does not show a current event as in progress) + new parameter |refresh=no per request at talk&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module powers {{countdown}}.&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('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
local function formatMessage(secondsLeft, event, color)&lt;br /&gt;
	local timeLeft = lang:formatDuration(secondsLeft, {'years', 'weeks', 'days', 'hours', 'minutes', 'seconds'})&lt;br /&gt;
	-- Find whether we are plural or not.&lt;br /&gt;
	local isOrAre&lt;br /&gt;
	if string.match(timeLeft, '^%d+') == '1' then&lt;br /&gt;
		isOrAre = 'is'&lt;br /&gt;
	else&lt;br /&gt;
		isOrAre = 'are'&lt;br /&gt;
	end&lt;br /&gt;
	-- Color and bold the numbers, because it makes them look important.&lt;br /&gt;
	timeLeft = string.gsub(timeLeft, '(%d+)', '&amp;lt;span style=&amp;quot;color: ' .. (color or '#F00') .. '; font-weight: bold;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;')&lt;br /&gt;
	return string.format('There %s %s until %s.', isOrAre, timeLeft, event)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
&lt;br /&gt;
	if not (args.year and args.month and args.day) then&lt;br /&gt;
		return '&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: year, month, and day must be specified&amp;lt;/strong&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local eventTime = os.time({year=args.year, month=args.month, day=args.day, hour=args.hour, min=args.minute, sec=args.second})&lt;br /&gt;
	local timeToStart = os.difftime(eventTime, os.time()) -- (future time - current time)&lt;br /&gt;
	local text&lt;br /&gt;
	if timeToStart &amp;gt; 0 then&lt;br /&gt;
		-- Event has not begun yet&lt;br /&gt;
		text = formatMessage(timeToStart, args.event or 'the event begins', args.color)&lt;br /&gt;
	elseif args.duration then&lt;br /&gt;
		local timeToEnd&lt;br /&gt;
		if args['duration unit'] then&lt;br /&gt;
			-- Duration is in unit other than seconds, use formatDate to add&lt;br /&gt;
			timeToEnd = tonumber(lang:formatDate('U', '@' .. tostring(timeToStart) .. ' +' .. tostring(args.duration) .. ' ' .. args['duration unit']))&lt;br /&gt;
		else&lt;br /&gt;
			timeToEnd = timeToStart + (tonumber(args.duration) or error('args.duration should be a number of seconds', 0))&lt;br /&gt;
		end&lt;br /&gt;
		if timeToEnd &amp;gt; 0 then&lt;br /&gt;
			-- Event is in progress&lt;br /&gt;
			text = args.eventstart or formatMessage(timeToEnd, (args.event or 'the event') .. ' ends', args.color)&lt;br /&gt;
		else&lt;br /&gt;
			-- Event had a duration and has now ended&lt;br /&gt;
			text = args.eventend or ((lang:ucfirst(args.event or 'The event')) .. ' has ended.')&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Event had no duration and has begun&lt;br /&gt;
		text = args.eventstart or ((lang:ucfirst(args.event or 'The event')) .. ' has started.')&lt;br /&gt;
	end&lt;br /&gt;
	local refreshLink&lt;br /&gt;
	if args.refresh == 'no' then&lt;br /&gt;
		refreshLink = ''&lt;br /&gt;
	else&lt;br /&gt;
		refreshLink = mw.title.getCurrentTitle():fullUrl({action = 'purge'})&lt;br /&gt;
		refreshLink = string.format(' &amp;lt;small&amp;gt;&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;([%s refresh])&amp;lt;/span&amp;gt;&amp;lt;/small&amp;gt;', refreshLink)&lt;br /&gt;
	end&lt;br /&gt;
	return text .. refreshLink&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;Johnuniq</name></author>
	</entry>
</feed>