Fix health daily movement graph again :-) #2986
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This just fixes a typo introduced by commit 31fb8f8 which causes the movement daily summary graph to freeze on the “Loading…” screen and print an error to the console due to trying to access the field name “hr” when it should be “day”.
While I was at it, I noticed what I thought might have been a potential out-of-bounds subscripting error in the *PerDay() functions. The array size is 31 (indeces 0…30) but the indeces actually returned by readDailySummaries are 1…31. However, it appears that the graph never displays a partial day's data before it rolls over, so maybe this would never be a problem because presumably the 31st day of the month would not display? It's technically inconsistent with the fact that the hourly funcs dimension the array to 24 rather than 23, though, but since I'm not sure, I decided to leave that alone for now.