mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
82aa0da5ec
commit
1b77255807
2 changed files with 5 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
- Tag: high level what changed (please replace this line with your first CHANGELOG entry)
|
- Desktop: translate trip date
|
||||||
---
|
---
|
||||||
* Always add new entries at the very top of this file above other existing entries and this note.
|
* Always add new entries at the very top of this file above other existing entries and this note.
|
||||||
* Use this layout for new entries: `[Area]: [Details about the change] [reference thread / issue]`
|
* Use this layout for new entries: `[Area]: [Details about the change] [reference thread / issue]`
|
||||||
|
|
|
@ -972,16 +972,12 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
|
||||||
utc_mkdate(when, &tm);
|
utc_mkdate(when, &tm);
|
||||||
QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*when,Qt::UTC);
|
QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*when,Qt::UTC);
|
||||||
localTime.setTimeSpec(Qt::UTC);
|
localTime.setTimeSpec(Qt::UTC);
|
||||||
QString ret ;
|
|
||||||
|
|
||||||
QString suffix = " " + gettextFromC::tr("(%n dive(s))", "", nr);
|
QString suffix = " " + gettextFromC::tr("(%n dive(s))", "", nr);
|
||||||
if (getday) {
|
if (getday)
|
||||||
ret = localTime.date().toString(prefs.date_format) + suffix;
|
return loc.toString(localTime, prefs.date_format) + suffix;
|
||||||
} else {
|
else
|
||||||
ret = localTime.date().toString("MMM yyyy") + suffix;
|
return loc.toString(localTime, "MMM yyyy") + suffix;
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static QMutex hashOfMutex;
|
static QMutex hashOfMutex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue