Bone Overlord.gif The Roost of the Graveborn Quest Spoiler!
Domine Graveborn: todos os bosses e mecânicas ilustradas!
Saiba mais ➔
Winter Tree.png Winter Update 2025
Acompanhe tudo sobre o Winter Update 2025!
Saiba mais ➔
Stag.gif The Order of the Stag Quest Spoiler!
Conheça Isle of Ada: sua quest, missões secundárias e todos os bosses!
Saiba mais ➔

MediaWiki:Tibiadrome.js: mudanças entre as edições

De Tibia Wiki - A Enciclopédia do Tibia
Ir para navegação Ir para pesquisar
Master Player
Master Player (discussão | contribs) (Tibiadrome calendar)
 
m
Linha 1: Linha 1:
$(document).ready(function () {
if (typeof mw !== 'undefined') {
   const secondRotation = new Date(1627372800 * 1000) // Tuesday July 27, 2021 10:00:00 (am) in time zone Europe/Berlin (CEST)
  mw.loader.load('moment')
   ready()
}


function ready () {
   $('#tibiadrome_cal').html('' +
   $('#tibiadrome_cal').html('' +
     '<table class="wikitable">' +
     '<table class="wikitable">' +
Linha 18: Linha 21:
     '</tr>' +
     '</tr>' +
     '</td></tr></tbody></table>')
     '</td></tr></tbody></table>')
   setInterval(UpdateTibiadrome, 1000)
   setInterval(updateTibiadrome, 1000)
}
 
function updateTibiadrome () {
  const secondRotation = new Date(1627372800 * 1000) // Tuesday July 27, 2021 10:00:00 (am) in time zone Europe/Berlin (CEST)


   function UpdateTibiadrome () {
   const now = new Date()
    const now = new Date()
  let rot = 2
    let rot = 2
  for (let i = 0; secondRotation + i * 14 * 24 * 60 * 60 * 1000 < now; i++) {
    for (let i = 0; secondRotation + i * 14 * 24 * 60 * 60 * 1000 < now; i++) {
    rot = 2 + i
      rot = 2 + i
    }
    $('#tibiadrome_rot').text(rot)
    $('#tibiadrome_start').text(secondRotation + (rot - 2) * 14 * 24 * 60 * 60 * 1000)
    $('#tibiadrome_end').text(secondRotation + (rot - 1) * 14 * 24 * 60 * 60 * 1000)
   }
   }
})
  $('#tibiadrome_rot').text(rot)
  $('#tibiadrome_start').text((secondRotation + (rot - 2) * 14 * 24 * 60 * 60 * 1000))
  $('#tibiadrome_end').text((secondRotation + (rot - 1) * 14 * 24 * 60 * 60 * 1000))
}

Edição das 19h13min de 21 de novembro de 2023

if (typeof mw !== 'undefined') {
  mw.loader.load('moment')
  ready()
}

function ready () {
  $('#tibiadrome_cal').html('' +
    '<table class="wikitable">' +
    '<tbody>' +
    '<tr>' +
    '<td><b>Rotação Atual</b></td>' +
    '<td id="tibiadrome_rot">-</td>' +
    '</tr>' +
    '<tr>' +
    '<td><b>Iniciou em</b></td>' +
    '<td id="tibiadrome_start">-</td>' +
    '</tr>' +
    '<tr>' +
    '<td><b>Terminará em</b></td>' +
    '<td id="tibiadrome_end">-</td>' +
    '</tr>' +
    '</td></tr></tbody></table>')
  setInterval(updateTibiadrome, 1000)
}

function updateTibiadrome () {
  const secondRotation = new Date(1627372800 * 1000) // Tuesday July 27, 2021 10:00:00 (am) in time zone Europe/Berlin (CEST)

  const now = new Date()
  let rot = 2
  for (let i = 0; secondRotation + i * 14 * 24 * 60 * 60 * 1000 < now; i++) {
    rot = 2 + i
  }
  $('#tibiadrome_rot').text(rot)
  $('#tibiadrome_start').text((secondRotation + (rot - 2) * 14 * 24 * 60 * 60 * 1000))
  $('#tibiadrome_end').text((secondRotation + (rot - 1) * 14 * 24 * 60 * 60 * 1000))
}