From a15843f070bd6743250544cb9ae477ab6f9eadf5 Mon Sep 17 00:00:00 2001 From: dodoradio Date: Fri, 4 Aug 2023 20:00:57 +0100 Subject: Fix steps graphs behaviour for less than a week of data Steps graph would previously select wrong day on click if there was less than a week of data. This fixes the issue --- src/stepCounter/StepCounterPreview.qml | 2 +- src/stepCounter/StepsDetailPage.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stepCounter/StepCounterPreview.qml b/src/stepCounter/StepCounterPreview.qml index 89f87fd..9042dd7 100644 --- a/src/stepCounter/StepCounterPreview.qml +++ b/src/stepCounter/StepCounterPreview.qml @@ -85,7 +85,7 @@ MouseArea { indicatorLineHeight: loggerSettings.stepGoalEnabled ? loggerSettings.stepGoalTarget : 0 onBarClicked: (index)=> { var d = new Date() - d.setDate(d.getDate() - 6 + index) + d.setDate(d.getDate() - valuesArr.length + 1 + index) pageStack.push(detailPage,{"currentDay": d}) } } diff --git a/src/stepCounter/StepsDetailPage.qml b/src/stepCounter/StepsDetailPage.qml index c792956..7949a2f 100644 --- a/src/stepCounter/StepsDetailPage.qml +++ b/src/stepCounter/StepsDetailPage.qml @@ -96,7 +96,7 @@ Item { indicatorLineHeight: loggerSettings.stepGoalEnabled ? loggerSettings.stepGoalTarget : 0 onBarClicked: (index)=> { var d = new Date() - d.setDate(d.getDate() - 6 + index) + d.setDate(d.getDate() - valuesArr.length + 1 + index) stepsLineGraph.startTime = d stepsLineGraph.endTime = d loadData() -- cgit v1.2.3-70-g09d2