Reformat dates

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>
This commit is contained in:
Loren Burkholder 2021-07-30 07:56:25 -04:00 committed by GitHub
parent 330b9d62a5
commit 3cb4209d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,13 +106,14 @@ ReadReceiptsModel::dateFormat(const QDateTime &then) const
auto days = then.daysTo(now); auto days = then.daysTo(now);
if (days == 0) if (days == 0)
return tr("Today %1") return tr("Today, %1")
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 2) else if (days < 2)
return tr("Yesterday %1") return tr("Yesterday, %1")
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));
else if (days < 7) else if (days < 7)
return QString("%1 %2") //: %1 is the name of the current day, %2 is the time the read receipt was read. The result may look like this: Monday, 7:15
return QString("%1, %2")
.arg(then.toString("dddd")) .arg(then.toString("dddd"))
.arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat));