diff options
author | dodoradio <dodoradio@outlook.com> | 2023-08-04 20:00:57 +0100 |
---|---|---|
committer | dodoradio <dodoradio@outlook.com> | 2023-08-18 14:10:48 +0100 |
commit | a15843f070bd6743250544cb9ae477ab6f9eadf5 (patch) | |
tree | 18e87d7e0d7347eb6dcc274ffbd4bbcc84039a5c | |
parent | 1452c4982eb50406ab88aa69cb53ce262d66e62b (diff) |
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
-rw-r--r-- | src/stepCounter/StepCounterPreview.qml | 2 | ||||
-rw-r--r-- | 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() |