public function FormatIntervalFormatter::settingsSummary in Date 8
Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsSummary().
File
- lib/
Drupal/ date/ Plugin/ field/ formatter/ FormatIntervalFormatter.php, line 181 - Definition of Drupal\date\Plugin\field\formatter\FormatIntervalFormatter.
Class
- FormatIntervalFormatter
- Plugin implementation of the 'format_interval'' formatter.
Namespace
Drupal\date\Plugin\field\formatterCode
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);
}