Daily & Weekly Steps along with their Summary are pre-calculated & stored in DB
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?