mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T308, using an optimized (faster) function for YYYYmmdd string parsing
Ref T309, found that QDateTime::fromString returns a QDateTime object with local timestamp. Using a optimized version returns UTC objects now. - The bug was found writing a unit test for Ref T308 - Slack: https://swift-project.slack.com/archives/G7GD2UP9C/p1534848725000100
This commit is contained in:
@@ -112,8 +112,7 @@ namespace BlackCore
|
||||
{
|
||||
// normally the timestamp is always updated from backend
|
||||
// if this changes in the future we're prepared
|
||||
updateTimestamp = QDateTime::fromString(ts, timestampFormat);
|
||||
updateTimestamp.setTimeSpec(Qt::UTC);
|
||||
updateTimestamp = fromStringUtc(ts, timestampFormat);
|
||||
if (this->getUpdateTimestamp() == updateTimestamp) return; // nothing to do
|
||||
|
||||
// save parsing and all follow up actions if nothing changed
|
||||
@@ -166,14 +165,12 @@ namespace BlackCore
|
||||
}
|
||||
else if (name == "time_end")
|
||||
{
|
||||
QDateTime t = QDateTime::fromString(value, timestampFormat);
|
||||
t.setTimeSpec(Qt::UTC);
|
||||
QDateTime t = fromStringUtc(value, timestampFormat);
|
||||
bookedStation.setBookedUntilUtc(t);
|
||||
}
|
||||
else if (name == "time_start")
|
||||
{
|
||||
QDateTime t = QDateTime::fromString(value, timestampFormat);
|
||||
t.setTimeSpec(Qt::UTC);
|
||||
QDateTime t = fromStringUtc(value, timestampFormat);
|
||||
bookedStation.setBookedFromUtc(t);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user