mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
cTimeFormat/cDateFormat -> QLocale::ShortFormat
This allows to use platform-specific formatting functions
This commit is contained in:
@@ -442,13 +442,13 @@ QString OnlineText(TimeId online, TimeId now) {
|
||||
const auto nowFull = base::unixtime::parse(now);
|
||||
const auto locale = QLocale();
|
||||
if (onlineFull.date() == nowFull.date()) {
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), cTimeFormat());
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_today(tr::now, lt_time, onlineTime);
|
||||
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), cTimeFormat());
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_yesterday(tr::now, lt_time, onlineTime);
|
||||
}
|
||||
const auto date = locale.toString(onlineFull.date(), cDateFormat());
|
||||
const auto date = locale.toString(onlineFull.date(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_date(tr::now, lt_date, date);
|
||||
}
|
||||
|
||||
@@ -469,14 +469,14 @@ QString OnlineTextFull(not_null<UserData*> user, TimeId now) {
|
||||
const auto nowFull = base::unixtime::parse(now);
|
||||
const auto locale = QLocale();
|
||||
if (onlineFull.date() == nowFull.date()) {
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), cTimeFormat());
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_today(tr::now, lt_time, onlineTime);
|
||||
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), cTimeFormat());
|
||||
const auto onlineTime = locale.toString(onlineFull.time(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_yesterday(tr::now, lt_time, onlineTime);
|
||||
}
|
||||
const auto date = locale.toString(onlineFull.date(), cDateFormat());
|
||||
const auto time = locale.toString(onlineFull.time(), cTimeFormat());
|
||||
const auto date = locale.toString(onlineFull.date(), QLocale::ShortFormat);
|
||||
const auto time = locale.toString(onlineFull.time(), QLocale::ShortFormat);
|
||||
return tr::lng_status_lastseen_date_time(tr::now, lt_date, date, lt_time, time);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user