Module:TwitterSnowflake: Difference between revisions

Fix a Lua error appearing on pages such as August 11 when there's no date
m (1 revision imported)
imported>Pppery
(Fix a Lua error appearing on pages such as August 11 when there's no date)
 
Line 31: Line 31:
end
end
frame.args.format = "%B %e, %Y"
frame.args.format = "%B %e, %Y"
if frame.args.date then
frame.args.date = mw.ustring.gsub(frame.args.date, "(%d%d%d%d)%a", "%1")
end
frame.args.epoch = tonumber(frame.args.epoch) or 1288834974
frame.args.epoch = tonumber(frame.args.epoch) or 1288834974
local epochdate = Date(os.date("%B %e, %Y", frame.args.epoch))
local epochdate = Date(os.date("%B %e, %Y", frame.args.epoch))
Anonymous user