You are here

public function Database::getDateFormatter in Search API 8

Retrieves the date formatter.

Return value

\Drupal\Core\Datetime\DateFormatterInterface The date formatter.

File

modules/search_api_db/src/Plugin/search_api/backend/Database.php, line 344

Class

Database
Indexes and searches items using the database.

Namespace

Drupal\search_api_db\Plugin\search_api\backend

Code

public function getDateFormatter() {
  return $this->dateFormatter ?: \Drupal::service('date.formatter');
}