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

152
Visualizações
How to fix Daily & Weekly summary pre calculation in database?

Daily & Weekly Steps along with their Summary are pre-calculated & stored in DB

  • Records logged on the different timestamps on a given day get summed.
  • Ex. On Monday, if a member logs 400, 500, 600, 1000, 500. The total steps on Monday will be 3000

Ex. If user A has set the daily target of 1000 steps & total steps for the current week stored in DB are as follows. Weekly average: Daily Sum / 7 = 1000 steps

{
    Monday: 1500, Tuesday: 0, Wednesday: 2500, Thursday: 2000, Friday: 0, Saturday: 0, Sunday: 1000
},

When the member changes the profile timezone, the summarised daily records stored in DB create an issue:

Weekly records in the previous timezone
 = {
    Monday: 1500, Tuesday: 0, Wednesday: 2500, Thursday: 2000, Friday: 0, Saturday: 0, Sunday: 1000
},
Weekly records in the current timezone = {
    Monday: 1500, Tuesday: 500, Wednesday: 2000, Thursday: 2000, Friday: 0, Saturday: 500, Sunday: 500
},

But, as we have pre-calculated & stored the data in DB. We are displaying the data based on the previous timezone. How to resolve this?

about 4 years ago · Juan Pablo Isaza
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