You are here

public static function ApStyleDateRangeFieldFormatter::defaultSettings in AP Style Date 8

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

File

src/Plugin/Field/FieldFormatter/ApStyleDateRangeFieldFormatter.php, line 82

Class

ApStyleDateRangeFieldFormatter
Plugin implementation of the 'timestamp' formatter as time ago.

Namespace

Drupal\date_ap_style\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  $config = \Drupal::config('date_ap_style.dateapstylesettings');
  $base_defaults = [
    'always_display_year' => $config
      ->get('always_display_year'),
    'display_day' => $config
      ->get('display_day'),
    'use_today' => $config
      ->get('use_today'),
    'cap_today' => $config
      ->get('cap_today'),
    'display_time' => $config
      ->get('display_time'),
    'time_before_date' => $config
      ->get('time_before_date'),
    'use_all_day' => $config
      ->get('use_all_day'),
    'display_noon_and_midnight' => $config
      ->get('display_noon_and_midnight'),
    'capitalize_noon_and_midnight' => $config
      ->get('capitalize_noon_and_midnight'),
    'timezone' => $config
      ->get('timezone'),
    'separator' => $config
      ->get('separator'),
  ];
  return $base_defaults + parent::defaultSettings();
}