2019-03-21 23:28:14 -04:00
|
|
|
import QtQuick 2.7
|
2019-03-26 05:52:43 -04:00
|
|
|
import "../base" as Base
|
2019-03-21 23:28:14 -04:00
|
|
|
|
2019-03-26 05:52:43 -04:00
|
|
|
Base.HLabel {
|
2019-04-21 20:55:24 -04:00
|
|
|
property bool isToday: {
|
|
|
|
const today = new Date()
|
|
|
|
return dateTime.getDate() == today.getDate() &&
|
|
|
|
dateTime.getMonth() == today.getMonth() &&
|
|
|
|
dateTime.getFullYear() == today.getFullYear()
|
|
|
|
}
|
|
|
|
|
2019-04-20 03:29:24 -04:00
|
|
|
width: messageDelegate.width
|
|
|
|
topPadding: messageDelegate.isFirstMessage ?
|
|
|
|
0 : messageDelegate.standardSpacing
|
|
|
|
bottomPadding: messageDelegate.standardSpacing
|
2019-04-20 17:36:21 -04:00
|
|
|
|
2019-04-21 20:55:24 -04:00
|
|
|
text: dateTime.toLocaleDateString() + (isToday ? qsTr(" (Today)") : "")
|
2019-04-20 17:36:21 -04:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2019-04-26 16:02:20 -04:00
|
|
|
font.pixelSize: Base.HStyle.fontSize.big
|
2019-03-21 23:28:14 -04:00
|
|
|
color: "darkolivegreen"
|
|
|
|
}
|