parent
599cc35e57
commit
be8aeb0d96
|
@ -89,12 +89,10 @@ void PaintRowDate(
|
||||||
const auto lastDate = lastTime.date();
|
const auto lastDate = lastTime.date();
|
||||||
|
|
||||||
const auto dt = [&] {
|
const auto dt = [&] {
|
||||||
const auto wasSameDay = (lastDate == nowDate);
|
if ((lastDate == nowDate)
|
||||||
const auto wasRecently = qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds;
|
|| (qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds)) {
|
||||||
if (wasSameDay || wasRecently) {
|
|
||||||
return QLocale().toString(lastTime.time(), QLocale::ShortFormat);
|
return QLocale().toString(lastTime.time(), QLocale::ShortFormat);
|
||||||
} else if (lastDate.year() == nowDate.year()
|
} else if (qAbs(lastDate.daysTo(nowDate)) < 7) {
|
||||||
&& lastDate.weekNumber() == nowDate.weekNumber()) {
|
|
||||||
return langDayOfWeek(lastDate);
|
return langDayOfWeek(lastDate);
|
||||||
} else {
|
} else {
|
||||||
return QLocale().toString(lastDate, QLocale::ShortFormat);
|
return QLocale().toString(lastDate, QLocale::ShortFormat);
|
||||||
|
|
Loading…
Reference in New Issue