From 37e98a8d89d8e8affc1a12e92f8359d66183caad Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Mon, 25 Dec 2017 18:53:43 +0100 Subject: [PATCH] Use correct date format A very very trival fix, for a mysterious issue. When loading GPS fix data from the server, the string date was parsed with the format "yyy-M-d". And no, the "yyy" is no typo here, but was the reason that data from the read from server got a 1/1/1970 data. And when a user decided to upload that data to the server again, we ended up with 2 copies of the GPS fix. One with correct data (as originally saved), and one new with the bogus date. In order to het rid of those weird 1/1/1970 GPS fixes, users will have to remove them by hand. Fixes: #567 Signed-off-by: Jan Mulder --- core/gpslocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 9db829b02..ccf183adc 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -601,7 +601,7 @@ void GpsLocation::downloadFromServer() qDebug() << downloadedFixes.count() << "GPS fixes downloaded"; for (int i = 0; i < downloadedFixes.count(); i++) { QJsonObject fix = downloadedFixes[i].toObject(); - QDate date = QDate::fromString(fix.value("date").toString(), "yyy-M-d"); + QDate date = QDate::fromString(fix.value("date").toString(), "yyyy-M-d"); QTime time = QTime::fromString(fix.value("time").toString(), "hh:m:s"); QString name = fix.value("name").toString(); QString latitude = fix.value("latitude").toString();