You are here

public function SmartDateDefaultFormatter::settingsSummary in Smart Date 3.0.x

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

2 methods override SmartDateDefaultFormatter::settingsSummary()
SmartDateDurationFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/SmartDateDurationFormatter.php
Returns a short summary for the current formatter settings.
SmartDateRecurrenceFormatter::settingsSummary in modules/smart_date_recur/src/Plugin/Field/FieldFormatter/SmartDateRecurrenceFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/SmartDateDefaultFormatter.php, line 91

Class

SmartDateDefaultFormatter
Plugin implementation of the 'Default' 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'),
  ]);
  return $summary;
}