aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordodoradio <dodoradio@outlook.com>2023-08-07 22:15:14 +0100
committerdodoradio <dodoradio@outlook.com>2023-08-18 14:10:57 +0100
commit2178972412ecbf4301990e55067575cdd1faf526 (patch)
treefa868973923576746b2c8d2dfbc015c00cd9e36d /src
parenta15843f070bd6743250544cb9ae477ab6f9eadf5 (diff)
Further tweaks and fixes to time labelling algorithm
Diffstat (limited to 'src')
-rw-r--r--src/graphs/TimeLabels.qml14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/graphs/TimeLabels.qml b/src/graphs/TimeLabels.qml
index b793040..514ce2a 100644
--- a/src/graphs/TimeLabels.qml
+++ b/src/graphs/TimeLabels.qml
@@ -49,9 +49,9 @@ Item {
date = new Date(currentTime*1000)
var value
if (date.getMinutes() == 0 | i == 0) {
- value = date.getHours() + (date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : date.getMinutes().toString())
- } else if (date.getMinutes() < 10) {
- value = date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : date.getMinutes().toString()
+ value = date.getHours() + (date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : "0" + date.getMinutes().toString())
+ } else {
+ value = date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : ":" + date.getMinutes().toString()
}
var x = (currentTime - startTime) / delta
listModel.append({"value": value, "x": x})
@@ -74,9 +74,9 @@ Item {
date = new Date(currentTime*1000)
var value
if (date.getMinutes() == 0 | i == 0) {
- value = date.getHours() + (date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : date.getMinutes().toString())
- } else if (date.getMinutes() < 10) {
- value = date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : date.getMinutes().toString()
+ value = date.getHours() + (date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : ":" + date.getMinutes().toString())
+ } else {
+ value = date.getMinutes() < 10 ? ":0" + date.getMinutes().toString() : ":" + date.getMinutes().toString()
}
var x = (currentTime - startTime) / delta
listModel.append({"value": value, "x": x})
@@ -102,7 +102,7 @@ Item {
while (currentTime < endTime) {
date = new Date(currentTime*1000)
var value
- if (date.getMinutes() != 0 | interval != 1800) {
+ if (date.getMinutes() == 0) {
value = date.getHours().toString() + "h"
} else {
value = ":" + date.getMinutes()