<?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%3ASandbox%2FDannyS712%2Fremind</id>
	<title>Module:Sandbox/DannyS712/remind - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FDannyS712%2Fremind"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/DannyS712/remind&amp;action=history"/>
	<updated>2026-05-27T20:20:49Z</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:Sandbox/DannyS712/remind&amp;diff=145306&amp;oldid=prev</id>
		<title>imported&gt;DannyS712: return the reminder</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/DannyS712/remind&amp;diff=145306&amp;oldid=prev"/>
		<updated>2019-02-26T06:05:55Z</updated>

		<summary type="html">&lt;p&gt;return the reminder&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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local function formatMessage(secondsLeft, event, color, refreshLink)&lt;br /&gt;
	local timeLeft = lang:formatDuration(secondsLeft, {&amp;#039;years&amp;#039;, &amp;#039;weeks&amp;#039;, &amp;#039;days&amp;#039;, &amp;#039;hours&amp;#039;, &amp;#039;minutes&amp;#039;, &amp;#039;seconds&amp;#039;})&lt;br /&gt;
	-- Find whether we are plural or not.&lt;br /&gt;
	local isOrAre&lt;br /&gt;
	if string.match(timeLeft, &amp;#039;^%d+&amp;#039;) == &amp;#039;1&amp;#039; then&lt;br /&gt;
		isOrAre = &amp;#039;is&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		isOrAre = &amp;#039;are&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- Color and bold the numbers, because it makes them look important.&lt;br /&gt;
	local timeLeft = string.gsub(timeLeft, &amp;#039;(%d+)&amp;#039;, &amp;#039;&amp;lt;span style=&amp;quot;color: &amp;#039; .. (color or &amp;#039;#F00&amp;#039;) .. &amp;#039;; font-weight: bold;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;&amp;#039;)&lt;br /&gt;
	-- Make the refresh link and join it all together.&lt;br /&gt;
	return string.format(&amp;#039;There %s %s until %s.%s&amp;#039;, isOrAre, timeLeft, event, refreshLink)&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;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: year, month, and day must be specified&amp;lt;/strong&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if not (args.reminder) then&lt;br /&gt;
		return  &amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: reminder must be specified&amp;lt;/strong&amp;gt;&amp;#039;&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;
&lt;br /&gt;
	if timeToStart &amp;gt; 0 then&lt;br /&gt;
		-- Reminder still pending&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		-- Reminder due&lt;br /&gt;
		return args.reminder&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;DannyS712</name></author>
	</entry>
</feed>