Overhaul room list sorting

This commit is contained in:
miruka
2019-04-21 20:55:24 -04:00
parent 424405e3e8
commit 237d750d47
8 changed files with 112 additions and 36 deletions

View File

@@ -2,12 +2,19 @@ import QtQuick 2.7
import "../base" as Base
Base.HLabel {
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
text: dateTime.toLocaleDateString()
text: dateTime.toLocaleDateString() + (isToday ? qsTr(" (Today)") : "")
horizontalAlignment: Text.AlignHCenter
font.pixelSize: normalSize * 1.1
color: "darkolivegreen"