mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Use default-constructed QLocale for date/time/whatever else formatting
Qt 6 chenged the QDateTime API to use QLocale::c() rather than QLocale::system(), using default-constructed QLocale will make this consistent and overradable application-wide Other formating use-cases as QLocale::decimalPoint use default-constructed QLocale now, too
This commit is contained in:
@@ -79,12 +79,12 @@ Authorizations::Entry ParseEntry(const MTPDauthorization &data) {
|
||||
const auto nowDate = now.date();
|
||||
const auto lastDate = lastTime.date();
|
||||
if (lastDate == nowDate) {
|
||||
result.active = lastTime.toString(cTimeFormat());
|
||||
result.active = QLocale().toString(lastTime, cTimeFormat());
|
||||
} else if (lastDate.year() == nowDate.year()
|
||||
&& lastDate.weekNumber() == nowDate.weekNumber()) {
|
||||
result.active = langDayOfWeek(lastDate);
|
||||
} else {
|
||||
result.active = lastDate.toString(cDateFormat());
|
||||
result.active = QLocale().toString(lastDate, cDateFormat());
|
||||
}
|
||||
}
|
||||
result.location = country;
|
||||
|
Reference in New Issue
Block a user