You are here

public function DateTimeFormatterBase::settingsSummary in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::settingsSummary()

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

3 calls to DateTimeFormatterBase::settingsSummary()
DateRangePlainFormatter::settingsSummary in core/modules/datetime_range/src/Plugin/Field/FieldFormatter/DateRangePlainFormatter.php
Returns a short summary for the current formatter settings.
DateTimeCustomFormatter::settingsSummary in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeCustomFormatter.php
Returns a short summary for the current formatter settings.
DateTimeDefaultFormatter::settingsSummary in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
Returns a short summary for the current formatter settings.
3 methods override DateTimeFormatterBase::settingsSummary()
DateRangePlainFormatter::settingsSummary in core/modules/datetime_range/src/Plugin/Field/FieldFormatter/DateRangePlainFormatter.php
Returns a short summary for the current formatter settings.
DateTimeCustomFormatter::settingsSummary in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeCustomFormatter.php
Returns a short summary for the current formatter settings.
DateTimeDefaultFormatter::settingsSummary in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
Returns a short summary for the current formatter settings.

File

core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php, line 111

Class

DateTimeFormatterBase
Base class for 'DateTime Field formatter' plugin implementations.

Namespace

Drupal\datetime\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($override = $this
    ->getSetting('timezone_override')) {
    $summary[] = $this
      ->t('Time zone: @timezone', [
      '@timezone' => $override,
    ]);
  }
  return $summary;
}