Module:Solar eclipse/sandbox: Difference between revisions

Content deleted Content added
slightly simplifying regex ([%d][%d]* to %d+
add auto minus
Line 74:
 
local function loadsolardb(frame, s)
local yearstr = s:match('^%s*([%d][%d][%d][%d])[A-Z][a-z][a-z][%d][%d]%s*$') or ''
local function setarg(k, v)
if(v and v ~= '') then args[k] = v end
v = mw.ustring.gsub(v, '^%s*%-(%d)', '−%1')
args[k] = v
end
end
if( yearstr ~= '' ) then