display year in meeting list if not this year

This commit is contained in:
Gaelle Braud 2025-07-22 09:13:34 +02:00
parent 7490cf0ca5
commit 5ca6876e92

View file

@ -236,7 +236,9 @@ QVariant ConferenceInfoList::data(const QModelIndex &index, int role) const {
if (role == Qt::DisplayRole) {
return QVariant::fromValue(new ConferenceInfoGui(mList[row].objectCast<ConferenceInfoCore>()));
} else if (role == Qt::DisplayRole + 1) {
return Utils::toDateMonthString(mList[row].objectCast<ConferenceInfoCore>()->getDateTimeUtc());
auto date = mList[row].objectCast<ConferenceInfoCore>()->getDateTimeUtc();
if (date.date().year() != QDate::currentDate().year()) return Utils::toDateMonthAndYearString(date);
else return Utils::toDateMonthString(date);
}
} else { // Dummy date
if (role == Qt::DisplayRole) {