Merge PR #111: fix datetime strings in presence and daylight views

This commit is contained in:
Jenkins 2019-01-07 14:03:50 +01:00
commit 5c59b39695

View File

@ -67,7 +67,8 @@ ListView {
Item {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.rowSpan: 3
Layout.minimumWidth: app.iconSize * 5
Layout.rowSpan: app.landscape ? 5 : 1
ColorIcon {
anchors.centerIn: parent
height: app.iconSize * 4
@ -76,6 +77,10 @@ ListView {
color: device.states.getState(boolView.stateType.id).value === true ? app.interfaceToColor(boolView.interfaceName) : keyColor
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
RowLayout {
Layout.fillWidth: false
Layout.alignment: Qt.AlignHCenter
@ -87,7 +92,7 @@ ListView {
font.bold: true
}
Label {
text: Qt.formatDateTime(new Date(parent.lastSeenState.value))
text: parent.lastSeenState ? Qt.formatDateTime(new Date(parent.lastSeenState.value * 1000)) : ""
}
}
RowLayout {
@ -101,7 +106,7 @@ ListView {
font.bold: true
}
Label {
text: parent.sunriseStateType ? Qt.formatDateTime(new Date(parent.sunriseState.value)) : ""
text: parent.sunriseStateType ? Qt.formatDateTime(new Date(parent.sunriseState.value * 1000)) : ""
}
}
RowLayout {
@ -115,7 +120,7 @@ ListView {
font.bold: true
}
Label {
text: parent.sunsetStateType ? Qt.formatDateTime(new Date(parent.sunsetState.value)) : ""
text: parent.sunsetStateType ? Qt.formatDateTime(new Date(parent.sunsetState.value * 1000)) : ""
}
}
Item {