You are here

function datex_date_element_info_alter in Datex 7

Adds datex as a date form element validator.

So we get a chance to convert Jalali to Greg.

File

datex_date/datex_date.module, line 114
Provides Jalali support for date module.

Code

function datex_date_element_info_alter(&$elements) {
  if (isset($elements['date_select'])) {
    if (isset($elements['date_select']['#element_validate'])) {
      $validator = $elements['date_select']['#element_validate'];
    }
    else {
      $validator = array();
    }
    $validator = array_merge(array(
      '_datex_date_element_validate_callback',
    ), $validator);
    $elements['date_select']['#element_validate'] = $validator;
  }
}