You are here

public function SmartDateDurationFormatter::settingsSummary in Smart Date 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::settingsSummary()
  2. 3.0.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::settingsSummary()
  3. 3.1.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::settingsSummary()
  4. 3.2.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::settingsSummary()
  5. 3.3.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::settingsSummary()
  6. 3.4.x src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDurationFormatter::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 SmartDateDefaultFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php, line 59

Class

SmartDateDurationFormatter
Plugin implementation of a duration-based formatter for 'smartdate' fields.

Namespace

Drupal\smart_date\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary[] = $this
    ->getSetting('timezone_override') === '' ? t('No timezone override.') : t('Timezone overridden to %timezone.', [
    '%timezone' => $this
      ->getSetting('timezone_override'),
  ]);
  $summary[] = t('Smart date format: %format.', [
    '%format' => $this
      ->getSetting('format'),
  ]);
  $summary[] = t('Duration separator: %duration_separator.', [
    '%duration_separator' => $this
      ->getSetting('duration_separator'),
  ]);
  return $summary;
}