2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

cTimeFormat/cDateFormat -> QLocale::ShortFormat

This allows to use platform-specific formatting functions
This commit is contained in:
Ilya Fedin
2022-12-15 13:47:56 +04:00
committed by John Preston
parent 9633f93690
commit 66093f0cb5
25 changed files with 46 additions and 73 deletions

View File

@@ -92,12 +92,12 @@ void PaintRowDate(
const auto wasSameDay = (lastDate == nowDate);
const auto wasRecently = qAbs(lastTime.secsTo(now)) < kRecentlyInSeconds;
if (wasSameDay || wasRecently) {
return QLocale().toString(lastTime, cTimeFormat());
return QLocale().toString(lastTime.time(), QLocale::ShortFormat);
} else if (lastDate.year() == nowDate.year()
&& lastDate.weekNumber() == nowDate.weekNumber()) {
return langDayOfWeek(lastDate);
} else {
return QLocale().toString(lastDate, cDateFormat());
return QLocale().toString(lastDate, QLocale::ShortFormat);
}
}();
PaintRowTopRight(p, dt, rectForName, context);