Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure daily reports dates translate to profile timezone
To illustrate the difference, I used chrome "sensors" feature to change my timezone to one that spans the dateline. > moment.tz('2023-01-19', 'America/Los_Angeles').endOf('day').format( ) '2023-01-19T23:59:59-08:00' > moment.tz(moment('2023-01-19'), 'America/Los_Angeles').endOf('day').format( ) '2023-01-18T23:59:59-08:00' The old code uses a string replacement, which is equivalent to the first test. This causes the dates on the reports to be off by one, as well as risks the data wrapping around the dateline so it can't be seen. For example, replacing "23:59:59" with "00:00:00" in the first example doesn't correctly wrap around the dateline. The patch introduces a way to parse the dates requested in the browser's time zone, and then translates them to the profile's timezone. The difference is shown in the second example above. With this change, the correct date label should be rendered, and the data should start at midnight without wrapping around the dateline.
- Loading branch information