diff options
Diffstat (limited to 'app/qml/DateAndTime.qml')
-rw-r--r-- | app/qml/DateAndTime.qml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/qml/DateAndTime.qml b/app/qml/DateAndTime.qml new file mode 100644 index 0000000..65afb0b --- /dev/null +++ b/app/qml/DateAndTime.qml @@ -0,0 +1,37 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.0 + +Item { + id: dateAndTime + + width: 53 * hspan + height: 33 * vspan + + property int hspan: 4 + property int vspan: 1 + property var currentDate: new Date(); + + RowLayout { + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + spacing: 10 + + CustomLabel { + font.capitalization: Font.AllUppercase + text: Qt.formatDateTime(dateAndTime.currentDate, "HH:mm") + + color: "#000000" + } + } + + Timer { + interval: 60000 + running: true + repeat: true + + onTriggered: { + dateAndTime.currentDate = new Date(); + } + } +} |