diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-17 09:02:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-17 09:04:16 -0800 |
commit | b59778abd8717ada5b592e8afc08dace0b7538a1 (patch) | |
tree | da828cca47c08a3c59bad1f0c22b89b4e6c5ddf8 | |
parent | a748e7f239f29f5aa63a7ff221d1bd5081e698a2 (diff) | |
download | subsurface-b59778abd8717ada5b592e8afc08dace0b7538a1.tar.gz |
mobile: use short date format in edit mode
See issue #949. In the dive list, dates are shown in short format, and
when we start to edit an existing dive, the date field on the edit
page is shown in sort format. However, when adding a new dive, the
initial date shows up in long (normal) format. This in not only
inconsistent, but also introduces the parsing problem, as described
in the mentioned issue.
This can be fixed by using short formatted dates in all cases in
the mobile app. As the screen real estate is precious on mobile,
this seems the most logical choice.
Fixed: #949
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 922fd8625..975e2eb92 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -714,7 +714,7 @@ bool QMLManager::checkDate(DiveObjectHelper *myDive, struct dive * d, QString da // what a pain - Qt will not parse dates if the day of the week is incorrect // so if the user changed the date but didn't update the day of the week (most likely behavior, actually), // we need to make sure we don't try to parse that - QString format(QString(prefs.date_format) + QChar(' ') + prefs.time_format); + QString format(QString(prefs.date_format_short) + QChar(' ') + prefs.time_format); if (format.contains(QLatin1String("ddd")) || format.contains(QLatin1String("dddd"))) { QString dateFormatToDrop = format.contains(QLatin1String("ddd")) ? QStringLiteral("ddd") : QStringLiteral("dddd"); QDateTime ts; @@ -1523,7 +1523,7 @@ QString QMLManager::getDate(const QString& diveId) struct dive *d = get_dive_by_uniq_id(dive_id); QString datestring; if (d) - datestring = get_dive_date_string(d->when); + datestring = get_short_dive_date_string(d->when); return datestring; } |