})
.then(clan => {
let tiernum = (rank) => rank <= 8 ? 1 : rank <= 25 ? 2 : rank <= 50 ? 3 : 4;
+ let matchtime = (d) => d.getDate() + '/' + (d.getMonth() + 1) +
+ ' ' + d.getHours() + ":" + ('0' + d.getMinutes()).slice(-2);
outcont.outerHTML = `
<h1>${clan.tag || clan.members[0].name}</h1>
<ul class=ladders>
</figure></a></li>
`).join('')}
</ul>
+ <ul class=matches>
+ ${clan.matches.splice(0, 3).map(match => `
+ <li data-members="${match.players}" class=${match.decision.toLowerCase()}>
+ ${matchtime(new Date(match.date * 1000))} ${match.type}
+ </li>
+ `).join('')}
+ </ul>
`
document.querySelectorAll('[data-members]').forEach(li => {