Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda