You are here

public function Twig_Extension_Core::setDateFormat in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Extension/Core.php \Twig_Extension_Core::setDateFormat()

Sets the default format to be used by the date filter.

Parameters

string $format The default date format string:

string $dateIntervalFormat The default date interval format string:

File

vendor/Twig/Extension/Core.php, line 50

Class

Twig_Extension_Core

Code

public function setDateFormat($format = null, $dateIntervalFormat = null) {
  if (null !== $format) {
    $this->dateFormats[0] = $format;
  }
  if (null !== $dateIntervalFormat) {
    $this->dateFormats[1] = $dateIntervalFormat;
  }
}