You are here

function date_interval_formatter_settings_form in Date 7

Same name and namespace in other branches
  1. 7.3 date_admin.inc \date_interval_formatter_settings_form()
  2. 7.2 date_admin.inc \date_interval_formatter_settings_form()

Settings for the interval formatter.

1 call to date_interval_formatter_settings_form()
date_field_formatter_settings_form in ./date.field.inc
Implements hook_field_formatter_settings_form().

File

./date_admin.inc, line 92
Date administration code. Moved to separate file since there is a lot of code here that is not needed often.

Code

function date_interval_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $form = array();
  $form['interval'] = array(
    '#title' => t('Interval'),
    '#description' => t("How many time units should be shown in the 'time ago' string."),
    '#type' => 'select',
    '#options' => drupal_map_assoc(range(1, 6)),
    '#default_value' => $settings['interval'],
    '#weight' => 0,
  );
  return $form;
}