Module:MLB standings: Difference between revisions

Content deleted Content added
fix bug if leading team has a .500 record
add mapping of full division name to abbreviation, so that link to corresponding template will work
Line 3:
 
local me = { }
 
local mlbData
 
-- if mw.loadData() not supported, use require() instead
if mw.loadData then
mlbData = mw.loadData('Module:Sandbox/isaacl/MLB standings/data')
else
mlbData = require('Module:Sandbox/isaacl/MLB standings/data')
end
 
 
Line 42 ⟶ 51:
local year = mw.text.trim(frame.args.year)
local division = mw.text.trim(frame.args.division)
 
if (mlbData.abbreviationForDivision[division] ~= nil) then
division = mlbData.abbreviationForDivision[division]
end
 
local listOfTeams = {};