Corrently add, edit and list journey details
[harbour-pedalo.git] / qml / pages / JourneyList.qml
index 9d84129..0468df0 100644 (file)
@@ -10,7 +10,7 @@ Page {
 
     SilicaListView {
         id: listView
-        model: 20
+        model: journeymodel
         anchors.fill: parent
         header: PageHeader {
             title: qsTr("Journey list")
@@ -24,21 +24,21 @@ Page {
 
                 Label {
                     width: columnwidth / 3.0
-                    text: qsTr("Item") + " " + index
+                    text: Qt.formatDate(journeymodel.epochToDate(start), "d MMM yyyy")
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
                 Label {
                     width: columnwidth / 3.0
-                    text: qsTr("1 May 2018")
+                    text: Qt.formatTime(journeymodel.epochToTime(start), "hh:mm")
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
                 Label {
                     width: columnwidth / 3.0
-                    text: qsTr("20 mins")
+                    text: Qt.formatTime(new Date(0, 0, 0, 0, 0, duration), 'hh:mm')
                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
                 }
             }
-            onClicked: pageStack.push(Qt.resolvedUrl("AddJourney.qml"), {title: "Edit journey"})
+            onClicked: pageStack.push(Qt.resolvedUrl("AddJourney.qml"), {title: "Edit journey", index: index, start: journeymodel.epochToDateTime(start), duration: duration, overtook: overtook, overtakenby: overtakenby})
         }
         VerticalScrollDecorator {}
     }