public function config_form_validation(array $data, $files = array()) : array {
        $errors = array();

        // Make sure the start year is not greater than the end year.
        if (!empty($data['configdata']['mindate']) && !empty($data['configdata']['maxdate']) &&
                $data['configdata']['mindate'] > $data['configdata']['maxdate']) {
            $errors['configdata[mindate]'] = get_string('mindateaftermax', 'customfield_date');
        }

        return $errors;
    }
public function config_form_validation(array $data, $files = array()) : array {
        $errors = array();

        // Make sure the start year is not greater than the end year.
        if (!empty($data['configdata']['mindate']) && !empty($data['configdata']['maxdate']) &&
                $data['configdata']['mindate'] > $data['configdata']['maxdate']) {
            $errors['configdata[mindate]'] = get_string('mindateaftermax', 'customfield_date');
        }

        return $errors;
    }
public function config_form_validation ( array $ data , $ files = array ( ) ) : array { $ errors = array ( ) ; // Make sure the start year is not greater than the end year. if ( ! empty ( $ data [ 'configdata' ] [ 'mindate' ] ) && ! empty ( $ data [ 'configdata' ] [ 'maxdate' ] ) && $ data [ 'configdata' ] [ 'mindate' ] > $ data [ 'configdata' ] [ 'maxdate' ] ) { $ errors [ 'configdata[mindate]' ] = get_string ( 'mindateaftermax' , 'customfield_date' ) ; } return $ errors ; }
Validate the data from the config form.

@param array $data
@param array $files
@return array associative array of error messages
Validate the data from the config form .