Fix daily summaries for 31st of the month - https://github.com/espruino/BangleApps/pull/2986

pull/2991/head
Gordon Williams 2023-08-29 17:04:37 +01:00
parent 646a4b010d
commit b75c2751c9
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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]++;