Widget:Test
Ir para navegação
Ir para pesquisar
<script> $(document).ready(function () {
Date.prototype.getWeekNumber = function () { let d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())); let dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); let yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil((((d - yearStart) / 86400000) + 1) / 7) };
const actualWeekNumber = new Date().getWeekNumber(); const bossCard = document.getElementById('boss-card');
const bosses = [ { name: 'Suicune', image: 'Card_Boss-Fight-Suicune.png' }, { name: 'Entei', image: 'Card_Boss-Fight-Entei.png' }, { name: 'Raikou', image: 'Card_Boss-Fight-Raikou.png' } ];
/* 1° Suicune 2° Entei 3° Raikou */
bossCard.src = bosses[actualWeekNumber % 3].image; bossCard.alt = bosses[actualWeekNumber % 3].name;
}); </script>