moment/harmonyqml/components/chat/Daybreak.qml

22 lines
675 B
QML
Raw Normal View History

2019-03-22 14:28:14 +11:00
import QtQuick 2.7
import "../base" as Base
2019-03-22 14:28:14 +11:00
Base.HLabel {
2019-04-22 10:55:24 +10:00
property bool isToday: {
const today = new Date()
return dateTime.getDate() == today.getDate() &&
dateTime.getMonth() == today.getMonth() &&
dateTime.getFullYear() == today.getFullYear()
}
width: messageDelegate.width
topPadding: messageDelegate.isFirstMessage ?
0 : messageDelegate.standardSpacing
bottomPadding: messageDelegate.standardSpacing
2019-04-22 10:55:24 +10:00
text: dateTime.toLocaleDateString() + (isToday ? qsTr(" (Today)") : "")
horizontalAlignment: Text.AlignHCenter
2019-04-27 06:02:20 +10:00
font.pixelSize: Base.HStyle.fontSize.big
2019-03-22 14:28:14 +11:00
color: "darkolivegreen"
}