[PATCH 1/2] qthelper.cpp: use timeFormat and dateFormat for the Dive class

Lubomir I. Ivanov neolit123 at gmail.com
Wed Sep 9 08:52:45 PDT 2015


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

The Dive class has a method which sets the m_time and m_date
members but it uses a custom format. By using the static
dateFormat and timeFormat variables this helper class now uses
the same date and time format as in the dive list.

Fixes #920

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 qthelper.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qthelper.cpp b/qthelper.cpp
index 51a8172..4ccc16d 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -167,8 +167,8 @@ void Dive::put_date_time()
 {
 	QDateTime localTime = QDateTime::fromTime_t(dive->when - gettimezoneoffset(displayed_dive.when));
 	localTime.setTimeSpec(Qt::UTC);
-	m_date = localTime.date().toString(QString::fromUtf8("MMM dd, yyyy"));
-	m_time = localTime.time().toString(QString::fromUtf8("hh:mm a"));
+	m_date = localTime.date().toString(dateFormat);
+	m_time = localTime.time().toString(timeFormat);
 }
 
 void Dive::put_timestamp()
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list