2019-03-22 14:28:14 +11:00
|
|
|
import QtQuick 2.7
|
2019-03-26 20:52:43 +11:00
|
|
|
import "../base" as Base
|
2019-03-22 14:28:14 +11:00
|
|
|
|
2019-03-26 20:52:43 +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()
|
|
|
|
}
|
|
|
|
|
2019-04-20 17:29:24 +10:00
|
|
|
width: messageDelegate.width
|
|
|
|
topPadding: messageDelegate.isFirstMessage ?
|
|
|
|
0 : messageDelegate.standardSpacing
|
|
|
|
bottomPadding: messageDelegate.standardSpacing
|
2019-04-21 07:36:21 +10:00
|
|
|
|
2019-04-22 10:55:24 +10:00
|
|
|
text: dateTime.toLocaleDateString() + (isToday ? qsTr(" (Today)") : "")
|
2019-04-21 07:36:21 +10:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2019-03-22 14:28:14 +11:00
|
|
|
font.pixelSize: normalSize * 1.1
|
|
|
|
color: "darkolivegreen"
|
|
|
|
}
|