From 3d01424f443d1f246344d4f62701cf68486ca334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 28 May 2024 21:34:40 +0200 Subject: [PATCH] Use consistent Date format across the whole GUI --- src/GUI/gui.cpp | 17 ++++++++--------- src/GUI/trackitem.cpp | 3 ++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 2e22fcbf..933a7c59 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -1307,14 +1307,14 @@ void GUI::statistics() + l.toString(_areaCount) + "
"); if (_dateRange.first.isValid()) { - QString format = l.dateFormat(QLocale::ShortFormat); if (_dateRange.first == _dateRange.second) text.append("" + tr("Date") + ": " - + _dateRange.first.toString(format) + "
"); + + l.toString(_dateRange.first, QLocale::ShortFormat) + "
"); else text.append("" + tr("Date") + ": " - + QString("%1 - %2").arg(_dateRange.first.toString(format), - _dateRange.second.toString(format)) + "
"); + + QString("%1 - %2").arg(l.toString(_dateRange.first, + QLocale::NarrowFormat), l.toString(_dateRange.second, + QLocale::NarrowFormat)) + "
"); } if (distance() > 0) @@ -1372,14 +1372,13 @@ void GUI::statistics() if (_dateRange.first.isValid()) { if (_dateRange.first == _dateRange.second) { - QString format = l.dateFormat(QLocale::LongFormat); text.append("" + tr("Date") + ":" - + _dateRange.first.toString(format) + ""); + + l.toString(_dateRange.first, QLocale::ShortFormat) + ""); } else { - QString format = l.dateFormat(QLocale::ShortFormat); text.append("" + tr("Date") + ":" - + QString("%1 - %2").arg(_dateRange.first.toString(format), - _dateRange.second.toString(format)) + ""); + + QString("%1 - %2").arg(l.toString(_dateRange.first, + QLocale::NarrowFormat), l.toString(_dateRange.second, + QLocale::NarrowFormat)) + ""); } } diff --git a/src/GUI/trackitem.cpp b/src/GUI/trackitem.cpp index 81cbce4a..78f0537e 100644 --- a/src/GUI/trackitem.cpp +++ b/src/GUI/trackitem.cpp @@ -24,7 +24,8 @@ ToolTip TrackItem::info() const if (_movingTime > 0) tt.insert(tr("Moving time"), Format::timeSpan(_movingTime)); if (!_date.isNull()) - tt.insert(tr("Date"), l.toString(_date.toTimeZone(_timeZone))); + tt.insert(tr("Date"), l.toString(_date.toTimeZone(_timeZone), + QLocale::ShortFormat)); if (!_links.isEmpty()) { QString links; for (int i = 0; i < _links.size(); i++) {