Ejemplo n.º 1
0
  public void validateEDD(String expectedDateOfDelivery, DateTime createdAt) {
    if (StringUtils.isNotEmpty(expectedDateOfDelivery)) {
      if (!ValidationUtils.assertDateFormat(expectedDateOfDelivery)) {
        errors.add("Invalid expected date of delivery %s", expectedDateOfDelivery);
        return;
      }

      if (!ValidationUtils.assertDateBefore(createdAt, parseDateTime(expectedDateOfDelivery)))
        errors.add("Invalid expected date of delivery %s", expectedDateOfDelivery);
    }
  }
Ejemplo n.º 2
0
  public void validateDOB(String dateOfBirth, DateTime createdAt) {
    if (StringUtils.isNotEmpty(dateOfBirth)) {
      if (!ValidationUtils.assertDateFormat(dateOfBirth)) {
        errors.add("Invalid date of birth %s", dateOfBirth);
        return;
      }

      if (!ValidationUtils.assertDateBefore(parseDateTime(dateOfBirth), createdAt))
        errors.add("Invalid date of birth %s", dateOfBirth);
    }
  }