You are here

function partial_date_field_widget_info in Partial Date 7

Implements hook_field_widget_info().

File

./partial_date.module, line 266
Defines a date element that allows for any combination of date granularity settings.

Code

function partial_date_field_widget_info() {
  return array(
    'partial_date' => array(
      'label' => t('Partial date'),
      'field types' => array(
        'partial_date',
        'partial_date_range',
      ),
      'settings' => array(
        'tz_handling' => 'none',
        'theme_overrides' => array(
          'check_approximate' => 0,
          'txt_short' => 0,
          'txt_long' => 0,
          'range_inline' => 0,
        ),
        'granularity' => array(
          'from' => drupal_map_assoc(array_keys(partial_date_components())),
          'to' => drupal_map_assoc(array_keys(partial_date_components())),
        ),
        'estimates' => array(
          'from' => array_combine(array_keys(partial_date_components(array(
            'timezone',
          ))), array_fill(0, 6, '')),
          'to' => array_combine(array_keys(partial_date_components(array(
            'timezone',
          ))), array_fill(0, 6, '')),
        ),
        'increments' => array(
          'second' => 1,
          'minute' => 1,
        ),
        'hide_remove' > 0,
        // @todo: i18n support here.
        'help_txt' => array(),
      ),
    ),
  );
}