All of the broken legacy things work.

This commit is contained in:
Petr Mrázek
2014-05-10 01:53:32 +02:00
parent 9860d5ee12
commit 92abe4c603
21 changed files with 701 additions and 356 deletions

View File

@ -0,0 +1,23 @@
#include <QDateTime>
#include <QString>
#include "ParseUtils.h"
#include <logic/MMCJson.h>
QDateTime timeFromS3Time(QString str)
{
return QDateTime::fromString(str, Qt::ISODate);
}
void parse_timestamp (const QString & raw, QString & save_here, QDateTime & parse_here)
{
save_here = raw;
if (save_here.isEmpty())
{
throw JSONValidationError("The timestamp is empty!");
}
parse_here = timeFromS3Time(save_here);
if (!parse_here.isValid())
{
throw JSONValidationError("The timestamp not a valid timestamp!");
}
}