aboutsummaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-16 08:56:36 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-16 16:55:55 -0800
commit1b77255807b9c11b1a1f6d3d504ccf2ade1d1d52 (patch)
tree285e2d69fd5e3fb273de256ac4e7af42787ac1a9 /core/qthelper.cpp
parent82aa0da5ec31dc5ffed76805fbc21de25b548463 (diff)
downloadsubsurface-1b77255807b9c11b1a1f6d3d504ccf2ade1d1d52.tar.gz
Dive list: correctly translate trip date
Adapt get_trip_date_string() to use the same logic as get_dive_date_string(): Use the static "loc" object to translate date. Before, the trip date was shown in C locale. Reported-by: Philippe Massart <philippe@philmassart.net> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 7a41f2a3f..27d94e4f5 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -972,16 +972,12 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
utc_mkdate(when, &tm);
QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*when,Qt::UTC);
localTime.setTimeSpec(Qt::UTC);
- QString ret ;
QString suffix = " " + gettextFromC::tr("(%n dive(s))", "", nr);
- if (getday) {
- ret = localTime.date().toString(prefs.date_format) + suffix;
- } else {
- ret = localTime.date().toString("MMM yyyy") + suffix;
- }
- return ret;
-
+ if (getday)
+ return loc.toString(localTime, prefs.date_format) + suffix;
+ else
+ return loc.toString(localTime, "MMM yyyy") + suffix;
}
static QMutex hashOfMutex;