]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/sql/sqlengine.cpp
If no day_change was given for a conference 4 AM is assumed.
[toast/confclerk.git] / src / sql / sqlengine.cpp
index e062387c1398481985bec0fcb442ceb8bad7b89d..9998467488b0c06c6dd375a93e7ecae5cb3adee6 100644 (file)
@@ -154,7 +154,8 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int confe
     }
     query.bindValue(":start", QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());
     query.bindValue(":end", QDateTime(QDate::fromString(aConference["end"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());
-    query.bindValue(":day_change", -QTime::fromString(aConference["day_change"],TIME_FORMAT).secsTo(QTime(0,0)));
+    QTime dayChange = QTime::fromString(aConference["day_change"].left(TIME_FORMAT.size()), TIME_FORMAT);
+    query.bindValue(":day_change", QTime(0, 0).secsTo(dayChange));
     query.bindValue(":timeslot_duration", -QTime::fromString(aConference["timeslot_duration"],TIME_FORMAT).secsTo(QTime(0,0)));
     query.bindValue(":active", 1);
     if (!insert) query.bindValue(":id", conferenceId);