You are here

protected function FieldTimerCountdownFormatter::preparePluginSettings in Field Timer 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Field/FieldFormatter/FieldTimerCountdownFormatter.php \Drupal\field_timer\Plugin\Field\FieldFormatter\FieldTimerCountdownFormatter::preparePluginSettings()

Prepares array of settings used to initialize jQuery plugin.

Parameters

\Drupal\Core\Field\FieldItemInterface $item: Field item.

string $langcode: Langcode value.

Return value

array Array of key-value pairs.

Overrides FieldTimerCountdownFormatterBase::preparePluginSettings

File

src/Plugin/Field/FieldFormatter/FieldTimerCountdownFormatter.php, line 213

Class

FieldTimerCountdownFormatter
Plugin implementation of the 'field_timer_countdown' formatter.

Namespace

Drupal\field_timer\Plugin\Field\FieldFormatter

Code

protected function preparePluginSettings(FieldItemInterface $item, $langcode) {
  $settings = parent::preparePluginSettings($item, $langcode);
  unset($settings['use_system_language']);
  $settings['regional'] = $this
    ->getLanguage($langcode);
  return $settings;
}