diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/DateTimeIntervalValidation.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/DateTimeIntervalValidation.java index ef944f00c..88e935808 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/DateTimeIntervalValidation.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/DateTimeIntervalValidation.java @@ -52,6 +52,11 @@ public class DateTimeIntervalValidation implements N3Validator { Map errors = new HashMap(); + if( formStartYear == null && formEndYear != null ){ + errors.put(startFieldName, "If there is an end date, there should be a start date"); + return errors; + } + if (formStartYear != null && formEndYear != null) { errors.putAll(checkDateLiterals(formStartYear, formEndYear, startPrecision, endPrecision)); } else if (formStartYear != null && existingEndYear != null) { @@ -98,14 +103,10 @@ public class DateTimeIntervalValidation implements N3Validator { VitroVocabulary.Precision startPrecision, VitroVocabulary.Precision endPrecision) { Map errors = new HashMap(); - //check to make sure that there are precisions - if( startPrecision == null ) - errors.put("startFieldName", "could not determine start precision"); - if( endPrecision == null ) - errors.put("endFieldName" , "could not determine end precision"); - if( errors.size() > 0 ) + if( endPrecision == null ){ + //there is no end date, nothing to check return errors; - + } try{ XSDDateTime startDate = (XSDDateTime)startLit.getValue();