You are here

public function DateFieldFormatIntervalFormatter::settingsSummary in Date 8

Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsSummary().

File

date_field/lib/Drupal/date_field/Plugin/field/formatter/DateFieldFormatIntervalFormatter.php, line 181
Definition of Drupal\date_field\Plugin\field\formatter\DateFieldFormatIntervalFormatter.

Class

DateFieldFormatIntervalFormatter
Plugin implementation of the 'format_interval'' formatter.

Namespace

Drupal\date_field\Plugin\field\formatter

Code

public function settingsSummary() {
  $field = $this->field;
  $instance = $this->instance;
  $settings = $this->settings;
  $view_mode = $this->viewMode;
  $weight = $this->weight;
  $label = $this->label;
  $definition = $this
    ->getDefinition();
  $formatter = $definition['id'];
  $summary = array();
  $summary[] = t('Display time ago, showing @interval units.', array(
    '@interval' => $settings['interval'],
  ));
  $context = array(
    'field' => $field,
    'instance' => $instance,
    'view_mode' => $view_mode,
    'formatter' => $formatter,
    'settings' => $settings,
  );
  drupal_alter('date_field_formatter_settings_summary', $summary, $context);
  return implode('<br />', $summary);
}