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;
    }