Added check for String format. (#198)

This commit is contained in:
Andreea Nechifor
2020-12-04 15:36:56 +02:00
committed by GitHub
parent 0e815ebe1a
commit 95f04cbf34

View File

@@ -122,10 +122,15 @@ public abstract class AbstractReplicationWebscript extends DeclarativeWebScript
if(schedule.has("start") && !schedule.isNull("start")) {
// Look for start:.... or start:{"iso8601":....}
String startDate = schedule.getString("start");
if(schedule.get("start") instanceof JSONObject) {
String startDate = null;
if (schedule.get("start") instanceof String)
{
startDate = schedule.getString("start");
}
else
{
startDate = schedule.getJSONObject("start").getString("iso8601");
}
}
replicationDefinition.setScheduleStart( ISO8601DateFormat.parse(startDate) );
} else {