mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
bug fix: set ride start time correctly in .gc files
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#define DATETIME_FORMAT "yyyy/MM/dd hh:mm:ss' UTC'"
|
||||||
|
|
||||||
static int gcFileReaderRegistered =
|
static int gcFileReaderRegistered =
|
||||||
RideFileFactory::instance().registerReader(
|
RideFileFactory::instance().registerReader(
|
||||||
"gc", "GoldenCheetah Native Format", new GcFileReader());
|
"gc", "GoldenCheetah Native Format", new GcFileReader());
|
||||||
@@ -53,7 +55,7 @@ GcFileReader::openRideFile(QFile &file, QStringList &errors) const
|
|||||||
if (key == "Device type")
|
if (key == "Device type")
|
||||||
rideFile->setDeviceType(value);
|
rideFile->setDeviceType(value);
|
||||||
if (key == "Start time")
|
if (key == "Start time")
|
||||||
rideFile->setStartTime(QDateTime::fromString(value)); // TODO format
|
rideFile->setStartTime(QDateTime::fromString(value, DATETIME_FORMAT).toLocalTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<double> intervalStops; // used to set the interval number for each point
|
QVector<double> intervalStops; // used to set the interval number for each point
|
||||||
@@ -132,7 +134,7 @@ GcFileReader::writeRideFile(const RideFile *ride, QFile &file) const
|
|||||||
attributes.appendChild(attribute);
|
attributes.appendChild(attribute);
|
||||||
attribute.setAttribute("key", "Start time");
|
attribute.setAttribute("key", "Start time");
|
||||||
attribute.setAttribute(
|
attribute.setAttribute(
|
||||||
"value", ride->startTime().toUTC().toString("yyyy/MM/dd hh:mm:ss' UTC'"));
|
"value", ride->startTime().toUTC().toString(DATETIME_FORMAT));
|
||||||
attribute = doc.createElement("attribute");
|
attribute = doc.createElement("attribute");
|
||||||
attributes.appendChild(attribute);
|
attributes.appendChild(attribute);
|
||||||
attribute.setAttribute("key", "Device type");
|
attribute.setAttribute("key", "Device type");
|
||||||
|
|||||||
Reference in New Issue
Block a user