src/org/ohmage/validator/VisualizationValidators.java
public static DateTime validateStartDate(final String startDate) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(startDate)) {
			return null;
		}
		
		try {
			return DateTimeUtils.getDateTimeFromString(startDate);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_DATE, 
					"Only a date is allowed, not time: " + startDate);
		}
	}
/**
	 * Validates that a start date string is a valid date and returns it. If it
	 * is not a valid date, the request is failed and an exception is thrown.
	 * 
	 * @param startDate The start date string to be validated.
	 * 
	 * @return Returns null the start date is null or whitespace only. 
	 * 		   Otherwise, the start date as a DateTime object is returned.
	 * 
	 * @throws ValidationException Thrown if the start date is not null, not
	 * 							   whitespace only, and not a valid date.
	 */
Validates that a start date string is a valid date and returns it. If it
is not a valid date, the request is failed and an exception is thrown.

@param startDate The start date string to be validated.

@return Returns null the start date is null or whitespace only.
Otherwise, the start date as a DateTime object is returned.

@throws ValidationException Thrown if the start date is not null, not
whitespace only, and not a valid date.
Validates that a start date string is a valid date and returns it . If it is not a valid date the request is failed and an exception is thrown . @param startDate The start date string to be validated . @return Returns null the start date is null or whitespace only . Otherwise the start date as a DateTime object is returned . @throws ValidationException Thrown if the start date is not null not whitespace only and not a valid date .
public static DateTime validateStartDate(final String startDate) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(startDate)) {
			return null;
		}
		try {
			return DateTimeUtils.getDateTimeFromString(startDate);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_DATE, 
					"Only a date is allowed, not time: " + startDate);
		}
	}
public static DateTime validateStartDate ( final String startDate ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( startDate ) ) { return null ; } try { return DateTimeUtils . getDateTimeFromString ( startDate ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_DATE , "Only a date is allowed, not time: " + startDate ) ; } }
Validates that a start date string is a valid date and returns it.
Validates that a start date string is a valid date and returns it .