month = jsonObject.getString("month");
}
if (jsonObject.has("year")) {
year = jsonObject.getString("year");
}
FormValidation dateValidation = checks.doCheckDateValue(year, month, day);
if (!dateValidation.equals(FormValidation.ok())) {
throw new Descriptor.FormException("Wrong date format " + dateValidation.getMessage(), "");
}
cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(day));
cal.set(Calendar.MONTH, Integer.parseInt(month) - DEFAULT_MONTH_ADJUSTMENT);
cal.set(Calendar.YEAR, Integer.parseInt(year));
if (jsonObject.has("details")) {
String hour = "";
String minute = "";
String second = "";
detailsCheck = true;
JSONObject details = jsonObject.getJSONObject("details");
if (details.has("hour")) {
hour = details.getString("hour");
}
if (details.has("minute")) {
minute = details.getString("minute");
}
if (details.has("second")) {
second = details.getString("second");
}
FormValidation timeValidation = checks.doCheckTimeValue(hour, minute, second);
if (!timeValidation.equals(FormValidation.ok())) {
throw new Descriptor.FormException("Wrong time format: " + timeValidation.getMessage(), "");
}
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour));
cal.set(Calendar.MINUTE, Integer.parseInt(minute));
cal.set(Calendar.SECOND, Integer.parseInt(second));
} else {