Module:Solar eclipse: Difference between revisions

Content deleted Content added
No edit summary
add time conversion
Line 48:
end
end
end
 
local function parsetime(s)
if(s and s ~= '') then
local min = s:match('^%s*([%d][%d]*)m%s*[%d][%d]*s%s*$')
local sec = s:match('^%s*[%d][%d]*m%s*([%d][%d]*)s%s*$')
if( min and sec ) then
return tostring(tonumber(min)*60 + tonumber(sec)) .. ' s' ..
'(' .. min .. ' m ' .. sec .. ' s)'
end
end
return s
end
 
Line 85 ⟶ 97:
setarg('saros_total', dargs['Max'])
setarg('max_eclipse_ref', '')
setarg('duration', parsetime(dargs['Dur']))
setarg('___location', '')
setarg('coords', parsecoord(frame,dargs['Loc']))