local p = {}
local lang = mw.language.getContentLanguage()
local getArgs = require('Module:Arguments').getArgs
local function formatMessage(secondsLeft, event, color)
local timeLeft = lang:formatDuration(secondsLeft, {'years', 'weeks', 'days', 'hours', 'minutes', 'seconds'})
local isOrAre
if string.match(timeLeft, '^%d+') == '1' then
isOrAre = 'is'
else
isOrAre = 'are'
end
timeLeft = string.gsub(timeLeft, '(%d+)', '<span style="color: ' .. (color or '#F00') .. '; font-weight: bold;">%1</span>')
return string.format('There %s %s until %s.', isOrAre, timeLeft, event)
end