summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/string-format.cpp7
-rw-r--r--core/string-format.h1
-rw-r--r--core/subsurface-qt/diveobjecthelper.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/core/string-format.cpp b/core/string-format.cpp
index 9de145b7a..5652a15bf 100644
--- a/core/string-format.cpp
+++ b/core/string-format.cpp
@@ -250,3 +250,10 @@ QString formatDiveTime(const dive *d)
QDateTime localTime = timestampToDateTime(d->when);
return localTime.time().toString(prefs.time_format);
}
+
+QString formatDiveDateTime(const dive *d)
+{
+ QDateTime localTime = timestampToDateTime(d->when);
+ return QStringLiteral("%1 %2").arg(localTime.date().toString(prefs.date_format_short),
+ localTime.time().toString(prefs.time_format));
+}
diff --git a/core/string-format.h b/core/string-format.h
index 12f36bd11..54a40b890 100644
--- a/core/string-format.h
+++ b/core/string-format.h
@@ -24,5 +24,6 @@ QString formatDiveDuration(const dive *d);
QString formatDiveGPS(const dive *d);
QString formatDiveDate(const dive *d);
QString formatDiveTime(const dive *d);
+QString formatDiveDateTime(const dive *d);
#endif
diff --git a/core/subsurface-qt/diveobjecthelper.h b/core/subsurface-qt/diveobjecthelper.h
index 30dee6bf7..8b328673f 100644
--- a/core/subsurface-qt/diveobjecthelper.h
+++ b/core/subsurface-qt/diveobjecthelper.h
@@ -96,6 +96,4 @@ public:
QString waterType;
};
-Q_DECLARE_METATYPE(DiveObjectHelper)
-
#endif