Module:PlayerTeamHistoryPopup

local util_args = require('Module:ArgsUtil') local util_cargo = require("Module:CargoUtil") local util_esports = require("Module:EsportsUtil") local util_html = require("Module:HtmlUtil") local util_map = require("Module:MapUtil") local util_math = require("Module:MathUtil") local util_news = require("Module:NewsUtil") local util_source = require("Module:SourceUtil") local util_table = require("Module:TableUtil") local util_text = require("Module:TextUtil") local util_time = require("Module:TimeUtil") local util_timedelta = require("Module:TimedeltaUtil") local util_vars = require("Module:VarsUtil") local i18n = require('Module:i18nUtil') local lang = mw.getLanguage('en')

local m_team = require('Module:Team') local m_region = require('Module:Region')

local PTHD = require('Module:PlayerTeamHistoryAbstract'):extends

function PTHD:init(name) self:super('init', name) self.COLUMNS = { 'RegionDisplay', 'TeamDisplay', 'RoleDisplay', 'DateJoinDisplay', 'DateLeaveDisplay', classes = { RoleDisplay = 'player-team-history-role', },		colclasses = { RoleDisplay = 'unsortable', RegionDisplay = 'unsortable', StatusDisplay = 'unsortable', },		sorttypes = { DateJoinPretty = 'number', DateLeave = 'number', DurationDisplay = 'number' } }

util_table.mergeArrays(		self.PRELOADS_TO_IGNORE,		{ 'confirm_role_swap', 'gcd_to_sub', 'loan_end_and_join', 'role_swap', 'sub_to_trainee', 'to_active', 'to_inactive', 'to_main_also_stay', 'to_starting', 'to_sub', 'to_trainee', 'loan_return', 'loaned_to', }	) end

local h = {}

local p = {} function p.main(frame) local args = util_args.merge return PTHD('PlayerTeamHistory'):run(args) end

function PTHD:getTeamDisplay(row) return row.Team and m_team.rightshortlinked(row.Team) end

function PTHD:getDateDisplay(row, when) local date = (row['Date_Display' .. when] or row['Date' .. when]) if not date then return nil end return util_news.formatDateApproxForTableDisplay(date, when) end

function PTHD:getKey(row) return row.Team end

return p