From c9adddb2f5a4f5995fefc4ce2859d8a04c0a5caa Mon Sep 17 00:00:00 2001 From: Arseniy Movshev Date: Wed, 18 Jan 2023 22:42:34 +0000 Subject: add a date display to waypoint page and fix date - Fix date recording (again) - correctly load both date displays in the waypoint page --- src/SetPointPage.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/SetPointPage.qml b/src/SetPointPage.qml index 9501db4..624e48d 100644 --- a/src/SetPointPage.qml +++ b/src/SetPointPage.qml @@ -20,7 +20,8 @@ Item { root.coord = QtPositioning.coordinate(currWaypointData[1][0],currWaypointData[1][1]) root.selectedIcon = currWaypointData[0] root.selectedColor = currWaypointData[2] - textbox.text = currWaypointData[3] + textBox.text = currWaypointData[3] + dateLabel.text = Qt.formatDateTime(currWaypointData[4]) } else { editIndex = waypointArray.length selectedColor = colors.secondary @@ -46,7 +47,13 @@ Item { width: parent.width height: parent.width*0.2 previewText: "Waypoint name" - text: Date.toLocaleString() + text: Qt.formatDateTime(new Date) + } + Asteroid.Label { + id: dateLabel + width: parent.width + height: root.width*0.1 + visible: editMode } ListView { id: iconSelectorView @@ -117,7 +124,7 @@ Item { writebuffer[1] = [coord.latitude,coord.longitude] writebuffer[2] = selectedColor //the colors.secondary is currently a placeholder. it would be nice to let users select colours, but I CBA to write a colour picker right now writebuffer[3] = textBox.text - writebuffer[4] = Date + writebuffer[4] = new Date() waypointArray[index] = writebuffer waypointList.value = JSON.stringify(waypointArray) setPointControls.visible = false -- cgit v1.2.3-70-g09d2