protected DateFormatter::dateFormat($format, $langcode)
Loads the given format pattern for the given langcode.
string $format: The machine name of the date format.
string $langcode: The langcode of the language to use.
string|null The pattern for the date format in the given language for non-custom formats, NULL otherwise.
protected function dateFormat($format, $langcode) { if (!isset($this->dateFormats[$format][$langcode])) { $original_language = $this->languageManager->getConfigOverrideLanguage(); $this->languageManager->setConfigOverrideLanguage(new Language(array('id' => $langcode))); $this->dateFormats[$format][$langcode] = $this->dateFormatStorage->load($format); $this->languageManager->setConfigOverrideLanguage($original_language); } return $this->dateFormats[$format][$langcode]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Datetime!DateFormatter.php/function/DateFormatter::dateFormat/8.1.x