You are here

public function DateRangeDatelistWidget::settingsSummary in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php \Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeDatelistWidget::settingsSummary()
  2. 9 core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php \Drupal\datetime_range\Plugin\Field\FieldWidget\DateRangeDatelistWidget::settingsSummary()

Returns a short summary for the current widget settings.

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

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php, line 145

Class

DateRangeDatelistWidget
Plugin implementation of the 'daterange_datelist' widget.

Namespace

Drupal\datetime_range\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $summary[] = $this
    ->t('Date part order: @order', [
    '@order' => $this
      ->getSetting('date_order'),
  ]);
  if ($this
    ->getFieldSetting('datetime_type') == DateRangeItem::DATETIME_TYPE_DATETIME) {
    $summary[] = $this
      ->t('Time type: @time_type', [
      '@time_type' => $this
        ->getSetting('time_type'),
    ]);
    $summary[] = $this
      ->t('Time increments: @increment', [
      '@increment' => $this
        ->getSetting('increment'),
    ]);
  }
  return $summary;
}