Commit 2ad1d3b1 authored by Volker Krause's avatar Volker Krause
Browse files

Fix deserialization of top-level QDateTime objects

parent a4584692
......@@ -210,7 +210,14 @@ static QVariant createInstance(const QJsonObject &obj)
MAKE_FACTORY(TrainStation);
MAKE_FACTORY(TrainTrip);
MAKE_FACTORY(UpdateAction);
MAKE_FACTORY(ViewAction);
MAKE_FACTORY(ViewAction);
if (type == QLatin1String("QDateTime")) {
auto dt = QDateTime::fromString(obj.value(QLatin1String("@value")).toString(), Qt::ISODate);
dt.setTimeZone(QTimeZone(obj.value(QLatin1String("timezone")).toString().toUtf8()));
return dt;
}
return {};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment