You are here

private function ApStyleDateFormatter::getOptions in AP Style Date 8

Get base default options from config when none are provided.

Return value

array The default config settings.

2 calls to ApStyleDateFormatter::getOptions()
ApStyleDateFormatter::formatRange in src/ApStyleDateFormatter.php
Format a timestamp to an AP style date format.
ApStyleDateFormatter::formatTimestamp in src/ApStyleDateFormatter.php
Format a timestamp to an AP style date format.

File

src/ApStyleDateFormatter.php, line 83

Class

ApStyleDateFormatter
Services for formatting date types using AP Style Date rules.

Namespace

Drupal\date_ap_style

Code

private function getOptions() {
  $base_defaults = [
    'always_display_year' => $this->config
      ->get('always_display_year'),
    'display_day' => $this->config
      ->get('display_day'),
    'use_today' => $this->config
      ->get('use_today'),
    'cap_today' => $this->config
      ->get('cap_today'),
    'display_time' => $this->config
      ->get('display_time'),
    'time_before_date' => $this->config
      ->get('time_before_date'),
    'use_all_day' => $this->config
      ->get('use_all_day'),
    'display_noon_and_midnight' => $this->config
      ->get('display_noon_and_midnight'),
    'capitalize_noon_and_midnight' => $this->config
      ->get('capitalize_noon_and_midnight'),
    'timezone' => $this->config
      ->get('timezone'),
  ];
  return $base_defaults;
}