qthelper.cpp: use timeFormat and dateFormat for the Dive class

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@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-09-09 18:52:45 +03:00 committed by Dirk Hohndel
parent 43627922e0
commit 6ff1837b05

View file

@ -167,8 +167,8 @@ void Dive::put_date_time()
{ {
QDateTime localTime = QDateTime::fromTime_t(dive->when - gettimezoneoffset(displayed_dive.when)); QDateTime localTime = QDateTime::fromTime_t(dive->when - gettimezoneoffset(displayed_dive.when));
localTime.setTimeSpec(Qt::UTC); localTime.setTimeSpec(Qt::UTC);
m_date = localTime.date().toString(QString::fromUtf8("MMM dd, yyyy")); m_date = localTime.date().toString(dateFormat);
m_time = localTime.time().toString(QString::fromUtf8("hh:mm a")); m_time = localTime.time().toString(timeFormat);
} }
void Dive::put_timestamp() void Dive::put_timestamp()