You are here

function date_field_info in Date 7

Same name and namespace in other branches
  1. 8 date.field.inc \date_field_info()
  2. 5.2 date/date.module \date_field_info()
  3. 5 date.module \date_field_info()
  4. 6.2 date/date.module \date_field_info()
  5. 6 date/date.module \date_field_info()
  6. 7.3 date.field.inc \date_field_info()
  7. 7.2 date.field.inc \date_field_info()

Implements hook_field_info().

3 calls to date_field_info()
date_tools_change_type_form in date_tools/date_tools.change_type.inc
A form to change the type of date used in date fields.
date_tools_change_type_form_submit in date_tools/date_tools.change_type.inc
date_tools_wizard_field_types in date_tools/date_tools.wizard.inc

File

./date.field.inc, line 175
Field hooks to implement a date field.

Code

function date_field_info() {
  $settings = array(
    'settings' => array(
      'todate' => '',
      'repeat' => 0,
      'granularity' => drupal_map_assoc(array(
        'year',
        'month',
        'day',
        'hour',
        'minute',
      )),
      'tz_handling' => 'site',
      'timezone_db' => 'UTC',
    ),
    'instance_settings' => array(
      'default_value' => 'now',
      'default_value_code' => '',
      'default_value2' => 'blank',
      'default_value_code2' => '',
      'default_format' => 'medium',
    ),
    // Integrate with the Entity Metadata module.
    'property_type' => 'date',
    'property_callbacks' => array(
      'date_entity_metadata_property_info_alter',
    ),
  );
  return array(
    'date' => array(
      'label' => 'Date',
      'description' => t('Store a date in the database as an ISO date, recommended for historical or partial dates.'),
      'default_widget' => 'date_select',
      'default_formatter' => 'date_default',
    ) + $settings,
    'datestamp' => array(
      'label' => 'Datestamp',
      'description' => t('Store a date in the database as a timestamp, deprecated format to suppport legacy data.'),
      'default_widget' => 'date_select',
      'default_formatter' => 'date_default',
    ) + $settings,
    'datetime' => array(
      'label' => 'Datetime',
      'description' => t('Store a date in the database as a datetime field, recommended for complete dates and times that may need timezone conversion.'),
      'default_widget' => 'date_select',
      'default_formatter' => 'date_default',
    ) + $settings,
  );
}