You are here

protected function DateTimeFormatterBase::getFormatSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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().

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

File

core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeFormatterBase.php, line 157
Contains \Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase.

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;
}