From b75c2751c9882a8c1a21e4d48e1d23a6b0438670 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 29 Aug 2023 17:04:37 +0100 Subject: [PATCH] Fix daily summaries for 31st of the month - https://github.com/espruino/BangleApps/pull/2986 --- apps/health/ChangeLog | 1 + apps/health/app.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/health/ChangeLog b/apps/health/ChangeLog index 489715931e..02b53c56dc 100644 --- a/apps/health/ChangeLog +++ b/apps/health/ChangeLog @@ -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 diff --git a/apps/health/app.js b/apps/health/app.js index 3b615ff1d1..db21d9243b 100644 --- a/apps/health/app.js +++ b/apps/health/app.js @@ -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); @@ -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]++; @@ -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]++;