Skip to content

Commit

Permalink
Fix daily summaries for 31st of the month - #2986
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Aug 29, 2023
1 parent 646a4b0 commit b75c275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/health/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
fix 11pm slot for daily HRM
0.26: Implement API for activity fetching
0.27: Fix typo in daily summary graph code causing graph not to load
Fix daily summaries for 31st of the month
10 changes: 5 additions & 5 deletions apps/health/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function stepsPerHour() {
function stepsPerDay() {
E.showMessage(/*LANG*/"Loading...");
current_selection = "stepsPerDay";
var data = new Uint16Array(31);
var data = new Uint16Array(32);
require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps);
setButton(menuStepCount);
barChart(/*LANG*/"DAY", data);
Expand All @@ -72,8 +72,8 @@ function hrmPerHour() {
function hrmPerDay() {
E.showMessage(/*LANG*/"Loading...");
current_selection = "hrmPerDay";
var data = new Uint16Array(31);
var cnt = new Uint8Array(31);
var data = new Uint16Array(32);
var cnt = new Uint8Array(32);
require("health").readDailySummaries(new Date(), h=>{
data[h.day]+=h.bpm;
if (h.bpm) cnt[h.day]++;
Expand All @@ -100,8 +100,8 @@ function movementPerHour() {
function movementPerDay() {
E.showMessage(/*LANG*/"Loading...");
current_selection = "movementPerDay";
var data = new Uint16Array(31);
var cnt = new Uint8Array(31);
var data = new Uint16Array(32);
var cnt = new Uint8Array(32);
require("health").readDailySummaries(new Date(), h=>{
data[h.day]+=h.movement;
cnt[h.day]++;
Expand Down

0 comments on commit b75c275

Please sign in to comment.