feat: add timestamp to news list page (#2050)

This commit is contained in:
vkamn
2025-12-11 18:51:01 +08:00
committed by GitHub
parent 40950b92ee
commit 3e6f0c0342
2 changed files with 2 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ QVariant NewsModel::data(const QModelIndex &index, int role) const
case IdRole: return item.id;
case TitleRole: return item.title;
case ContentRole: return item.content;
case TimestampRole: return item.timestamp.toString(Qt::ISODate);
case TimestampRole: return item.timestamp.toLocalTime().toString(Qt::ISODate);
case IsReadRole: return item.read;
case IsProcessedRole: return index.row() == m_processedIndex;
default: return QVariant();

View File

@@ -65,6 +65,7 @@ PageType {
leftImageSource: read ? "" : "qrc:/images/controls/unread-dot.svg"
isSmallLeftImage: !read
text: title
descriptionText: Qt.formatDateTime(timestamp, "dd.MM.yyyy HH:mm")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {