Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
Chrome Extension date and time not updated when extension working

I am making extension. I get date and time with "getDateAndTime();" function.

function getDateAndTime() {
return (date.getDate()<10? "0" : "") + date.getDate() + " " + months_tr[date.getMonth()] + " " + date.getFullYear() + " - " + (date.getHours()<10? "0" : "") + date.getHours() + "." + (date.getMinutes()<10? "0" : "") + date.getMinutes(); 
}

The first time the extension runs, the date and time are updated, but then when the function is called again, the data is not updated.

How can I keep the date and time up to date?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have a date variable that declared out of the function. It's declared once so it will remain the same.

I guess you want to add:

function getDateAndTime() {
    const date = new Date();
    ....
}

It means that the date is updated for everyone calls this function.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda