mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
parent
599cc35e57
commit
be8aeb0d96
1 changed files with 3 additions and 5 deletions
|
@ -89,12 +89,10 @@ void PaintRowDate(
|
|||
const auto lastDate = lastTime.date();
|
||||
|
||||
const auto dt = [&] {
|
||||
const auto wasSameDay = (lastDate == nowDate);
|
||||
const auto wasRecently = qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds;
|
||||
if (wasSameDay || wasRecently) {
|
||||
if ((lastDate == nowDate)
|
||||
|| (qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds)) {
|
||||
return QLocale().toString(lastTime.time(), QLocale::ShortFormat);
|
||||
} else if (lastDate.year() == nowDate.year()
|
||||
&& lastDate.weekNumber() == nowDate.weekNumber()) {
|
||||
} else if (qAbs(lastDate.daysTo(nowDate)) < 7) {
|
||||
return langDayOfWeek(lastDate);
|
||||
} else {
|
||||
return QLocale().toString(lastDate, QLocale::ShortFormat);
|
||||
|
|
Loading…
Add table
Reference in a new issue