diff --git a/components/match2/wikis/ageofempires/match_group_input_custom.lua b/components/match2/wikis/ageofempires/match_group_input_custom.lua index 0438cc9a5b1..5fa70712dfe 100644 --- a/components/match2/wikis/ageofempires/match_group_input_custom.lua +++ b/components/match2/wikis/ageofempires/match_group_input_custom.lua @@ -295,7 +295,16 @@ function CustomMatchGroupInput.processOpponent(record, timestamp) opponent = {type = Opponent.literal, name = 'BYE'} end - Opponent.resolve(opponent, timestamp, {syncPlayer = true}) + ---@type number|string + local teamTemplateDate = timestamp + -- If date is default date, resolve using tournament dates instead + -- default date indicates that the match is missing a date + -- In order to get correct child team template, we will use an approximately date and not the default date + if teamTemplateDate == DateExt.defaultTimestamp then + teamTemplateDate = DateExt.getContextualDateOrNow() + end + + Opponent.resolve(opponent, teamTemplateDate, {syncPlayer = true}) MatchGroupInput.mergeRecordWithOpponent(record, opponent) end