1 date.field.inc date_field_widget_info()

Implements hook_field_widget_info().

File

core/modules/date/date.field.inc, line 269
Field hooks to implement a date field.

Code

function date_field_widget_info() {
  $settings = array(
    'settings' => array(
      'input_format' => date_default_format('date_select'),
      'input_format_custom' => '',
      'increment' => 1,
      'text_parts' => array(),
      'year_range' => '-3:+3',
      'label_position' => 'none',
      'no_fieldset' => TRUE,
    ),
    'behaviors' => array(
      'multiple values' => FIELD_BEHAVIOR_DEFAULT,
      'default value' => FIELD_BEHAVIOR_NONE,
    ),
  );

  $info = array(
    'date_popup' => array(
      'label' => t('Pop-up calendar'),
      'field types' => array('date', 'datestamp', 'datetime'),
    ) + $settings,
    'date_select' => array(
      'label' => t('Select list'),
      'field types' => array('date', 'datestamp', 'datetime'),
    ) + $settings,
    'date_text' => array(
      'label' => t('Text field'),
      'field types' => array('date', 'datestamp', 'datetime'),
    ) + $settings,
  );

  // Add the fieldset option for select fields only.
  $info['date_select']['settings']['no_fieldset'] = FALSE;

  return $info;
}