Module:Solar eclipse: Difference between revisions

Content deleted Content added
format
simplify
Line 15:
local lang = mw.language.getContentLanguage()
d = (tonumber(d) < 10) and ('0' .. tonumber(d)) or (d)
m = (tonumber(m) < 10) and ('0' .. tonumber(m)) or (m)
if(d and d ~= '') then
local success, result = pcall(lang.formatDate, lang, 'F j, Y', y .. '-' .. m .. '-' .. d)
return success and result or nil
else
local success, result = pcall(lang.formatDate, lang, 'F Y', y .. '-' .. m .. '-01')
return success and result or nil
end
end