forked from FOSS/BangleApps
health: include step data for today
parent
b639dd41f9
commit
799c0b4e89
|
@ -72,6 +72,10 @@ function stepsPerDay(back, mult) {
|
||||||
current_selection = "stepsPerDay";
|
current_selection = "stepsPerDay";
|
||||||
var data = new Uint16Array(32);
|
var data = new Uint16Array(32);
|
||||||
require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps);
|
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) {
|
if (mult !== undefined) {
|
||||||
// Calculate distance from steps
|
// Calculate distance from steps
|
||||||
data.forEach((d, i) => data[i] = d*mult+0.5);
|
data.forEach((d, i) => data[i] = d*mult+0.5);
|
||||||
|
|
Loading…
Reference in New Issue