You are here

function date_api_date_time_settings_validate in Date 6.2

1 string reference to 'date_api_date_time_settings_validate'
date_api_add_date_formats_form in ./date_api.admin.inc
Allow users to add additional date formats.

File

./date_api.admin.inc, line 132
Administrative page callbacks for the date_api module.

Code

function date_api_date_time_settings_validate($form, &$form_state) {
  $formats = date_get_formats('custom');
  if (!empty($formats) && in_array($form_state['values']['add_date_format'], array_keys($formats))) {
    form_set_error('add_date_format', t('This format already exists.  Please enter a unique format string.'));
  }
}