From 799c0b4e8957ee6e211a6b3fdff86561652d0d78 Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Mon, 11 Dec 2023 07:32:58 +0100 Subject: [PATCH] health: include step data for today --- apps/health/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/health/app.js b/apps/health/app.js index 0b4cef233..221673e45 100644 --- a/apps/health/app.js +++ b/apps/health/app.js @@ -72,6 +72,10 @@ function stepsPerDay(back, mult) { current_selection = "stepsPerDay"; var data = new Uint16Array(32); require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps); + // Include data for today + if (data[(new Date()).getDate()] === 0) { + data[(new Date()).getDate()] = Bangle.getHealthStatus("day").steps; + } if (mult !== undefined) { // Calculate distance from steps data.forEach((d, i) => data[i] = d*mult+0.5);