You are here

protected function TempStoreTrait::getDateFormatter in Rules 8.3

Retrieves the date formatter service if not already present.

Return value

\Drupal\Core\Datetime\DateFormatterInterface The service.

File

src/Ui/TempStoreTrait.php, line 108

Class

TempStoreTrait
Provides methods for modified rules components in temporary storage.

Namespace

Drupal\rules\Ui

Code

protected function getDateFormatter() {
  if (!isset($this->dateFormatter)) {
    $this->dateFormatter = \Drupal::service('date.formatter');
  }
  return $this->dateFormatter;
}