docs: function createDateChecks(fieldDefinition, fieldName) {
    let checks = [];
  
    // -----------------------
    // check default value
    // -----------------------
    let defaultValue;
    if (fieldDefinition.defaultValue !== undefined) {
      defaultValue = parseDateString(fieldDefinition.defaultValue);
      if (defaultValue === undefined) {
        throw {
          errorCode: 'NOT_DATE',
          fieldName: 'defaultValue',
          value: fieldDefinition.defaultValue,
          message: 'The defaultValue in the fieldDefinition is not a valid date value.'
        };
      }
    }
    // -----------------------
    // check min date
    // -----------------------
    let minDate;
    const minDateStr = propertyHelper.getProperty(fieldDefinition, 'minDate');
    if (minDateStr !== undefined) {
      minDate = parseDateString(minDateStr);
      // Check that the given minDate is a valid date
      if (!minDate) {
        throw {
          errorCode: 'NOT_DATE_MIN_DATE',
          fieldName: 'check minDate',
          value: minDateStr,
          message: 'The min date in the constraints is not valid'
        };
      }
    }
  
    // -----------------------
    // check max date
    // -----------------------
    let maxDate;
    const maxDateStr = propertyHelper.getProperty(fieldDefinition, 'maxDate');
    if (maxDateStr !== undefined) {
      maxDate = parseDateString(maxDateStr);
      // Check that the given minDate is a valid date
      if (!maxDate) {
        throw {
          errorCode: 'NOT_DATE_MAX_DATE',
          fieldName: 'maxDate',
          value: maxDateStr,
          message: 'The max date in the constraints is not valid'
        };
      }
    }
  
    const minDateSeverity = propertyHelper.getSeverity(fieldDefinition, 'minDate');
    const maxDateSeverity = propertyHelper.getSeverity(fieldDefinition, 'maxDate');
  
  
    // -----------------------------------------------------------------------
    // Create DATE Check
    // -----------------------------------------------------------------------
  
  
    /** ************************************************************************
     * Checks that the given value is a valid date
     * @param content the content hash to be validated.
     * @return error an error object if the given value is not a valid date
     * *************************************************************************
     */
  
    let errorInfo = {
      severity: fieldDefinition.severity,
      errorCode: 'NOT_DATE'
    };
  
    checks.push(functionHelper.getParserCheck(errorInfo, parseDateString, fieldName, defaultValue));
  
    // -----------------------------------------------------------------------
    // Create MIN_DATE Check
    // we need a further check to check the date against the min date
    // -----------------------------------------------------------------------
    if (minDate) {
      /**
       * Checks that the given value is not before the given min date
       * @param content the content hash to be validated.
       * @return error an error object if the given value is not a valid date
       */
      checks.push(function (content) {
        const valueToCheck = content[fieldName];
        // If the value is defined, we need to check it
        if (valueToCheck !== undefined && valueToCheck !== null) {
  
          let errors = [];
  
          if (Array.isArray(valueToCheck)) {
            valueToCheck.forEach(function (item, idx, arr) {
  
              const date = parseDateString(item);
              if (date) {
                // it is a valid date.
                if (moment(date).isBefore(minDate)) {
  
                  // this date is out of range
                  errors.push({
                    errorCode: 'DATE_BEFORE_MIN_DATE',
                    severity: minDateSeverity,
                    fieldName: fieldName,
                    value: item,
                    message: minDate
                  });
                }
              }
  
            });
          } else {
            const date = parseDateString(valueToCheck);
            if (date) {
              // it is a valid date.
              if (moment(date).isBefore(minDate)) {
  
                // this date is out of range
                errors.push({
                  errorCode: 'DATE_BEFORE_MIN_DATE',
                  severity: minDateSeverity,
                  fieldName: fieldName,
                  value: valueToCheck,
                  message: minDate
                });
              }
            }
          }
  
          if (errors.length == 1) {
            return errors[0];
          } else if (errors.length > 0) {
            return errors;
          }
  
  
        }
      });
    }
  
    // -----------------------------------------------------------------------
    // Create MAX_DATE Check
    // we need a further check to check the date against the max date
    // -----------------------------------------------------------------------
  
    // we need a further check to check the date against the max date
    if (maxDate) {
      /**
       * Checks that the given value is not before the given min date
       * @param content the content hash to be validated.
       * @return error an error object if the given value is not a valid date
       */
      checks.push(function (content) {
  
        const valueToCheck = content[fieldName];
  
        // If the value is defined, we need to check it
        if (valueToCheck !== undefined && valueToCheck !== null) {
  
  
          let errors = [];
  
          if (Array.isArray(valueToCheck)) {
            valueToCheck.forEach(function (item, idx, arr) {
  
              const date = parseDateString(item);
              if (date) {
                // it is a valid date.
                if (moment(date).isAfter(maxDate)) {
  
                  // this date is out of range
                  errors.push({
                    errorCode: 'DATE_EXEEDS_MAX_DATE',
                    severity: maxDateSeverity,
                    fieldName: fieldName,
                    value: item,
                    message: maxDate
                  });
                }
              }
  
            });
          } else {
            const date = parseDateString(valueToCheck);
            if (date) {
              // it is a valid date.
              if (moment(date).isAfter(maxDate)) {
  
                // this date is out of range
                errors.push({
                  errorCode: 'DATE_EXEEDS_MAX_DATE',
                  severity: maxDateSeverity,
                  fieldName: fieldName,
                  value: valueToCheck,
                  message: maxDate
                });
              }
            }
          }
  
          if (errors.length == 1) {
            return errors[0];
          } else if (errors.length > 0) {
            return errors;
          }
        }
      });
  
    }
  
    return checks;
  }