You are here

protected function DateTimeFormatterBase::getFormatSettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::getFormatSettings()

Gets a settings array suitable for DrupalDateTime::format().

Return value

array The settings array that can be passed to DrupalDateTime::format().

1 call to DateTimeFormatterBase::getFormatSettings()
DateTimeCustomFormatter::settingsSummary in core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeCustomFormatter.php
Returns a short summary for the current formatter settings.

File

core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php, line 182

Class

DateTimeFormatterBase
Base class for 'DateTime Field formatter' plugin implementations.

Namespace

Drupal\datetime\Plugin\Field\FieldFormatter

Code

protected function getFormatSettings() {
  $settings = [];
  if ($this
    ->getSetting('timezone_override') != '') {
    $settings['timezone'] = $this
      ->getSetting('timezone_override');
  }
  return $settings;
}