You are here

public function SmartDateRecurrenceFormatter::settingsSummary in Smart Date 3.2.x

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

modules/smart_date_recur/src/Plugin/Field/FieldFormatter/SmartDateRecurrenceFormatter.php, line 86

Class

SmartDateRecurrenceFormatter
Plugin for a recurrence-optimized formatter for 'smartdate' fields.

Namespace

Drupal\smart_date_recur\Plugin\Field\FieldFormatter

Code

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