You are here

public function DurationTimeFormatter::settingsSummary in Duration Field 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/DurationTimeFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationTimeFormatter::settingsSummary()
  2. 3.0.x src/Plugin/Field/FieldFormatter/DurationTimeFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationTimeFormatter::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

File

src/Plugin/Field/FieldFormatter/DurationTimeFormatter.php, line 86

Class

DurationTimeFormatter
Provides a time format formatter for the Duration field type.

Namespace

Drupal\duration_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $summary[] = $this
    ->t('Displays the duration in the format: YY/MM/DD HH:MM:SS');
  $summary[] = $this
    ->t('If only date components are part of the field granularity, time will not be shown');
  $summary[] = $this
    ->t('If only time components are part of the field granularity, the date will not be shown.');
  return $summary;
}