You are here

function date_form_alter in Date 6

Same name and namespace in other branches
  1. 5.2 date/date.module \date_form_alter()
  2. 5 date.module \date_form_alter()
  3. 6.2 date/date.module \date_form_alter()
  4. 7 date.module \date_form_alter()

Implementation of hook_form_alter(). Make sure date information gets updated.

File

date/date.module, line 324
Defines date/time field types for the Content Construction Kit (CCK).

Code

function date_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'views_edit_view') {
    $form['#submit'] = array_merge($form['#submit'], array(
      'date_clear_all',
    ));
  }
  elseif ($form_id == '_content_admin_field' && ($form['type']['#value'] == 'date' || $form['type']['#value'] == 'datestamp' || $form['type']['#value'] == 'datetime')) {
    $form['#validate'] = array_merge($form['#validate'], array(
      'date_settings_validate',
    ));
  }
}