Neos\Flow\I18n\Cldr\Reader\DatesReader::parseCustomFormat PHP Method

parseCustomFormat() public method

Returns parsed date or time format string provided as parameter.
public parseCustomFormat ( string $format ) : array
$format string Format string to parse
return array An array representing parsed format
    public function parseCustomFormat($format)
    {
        if (isset($this->parsedFormats[$format])) {
            return $this->parsedFormats[$format];
        }
        return $this->parsedFormats[$format] = $this->parseFormat($format);
    }

Usage Example

 /**
  * Returns dateTime formatted by custom format, string provided in parameter.
  *
  * Format must obey syntax defined in CLDR specification, excluding
  * unimplemented features (see documentation for DatesReader class).
  *
  * Format is remembered in this classes cache and won't be parsed again for
  * some time.
  *
  * @param \DateTimeInterface $dateTime PHP object representing particular point in time
  * @param string $format Format string
  * @param Locale $locale A locale used for finding literals array
  * @return string Formatted date / time. Unimplemented subformats in format string will be silently ignored
  * @api
  * @see \Neos\Flow\I18n\Cldr\Reader\DatesReader
  */
 public function formatDateTimeWithCustomPattern(\DateTimeInterface $dateTime, $format, Locale $locale)
 {
     return $this->doFormattingWithParsedFormat($dateTime, $this->datesReader->parseCustomFormat($format), $this->datesReader->getLocalizedLiteralsForLocale($locale));
 }
All Usage Examples Of Neos\Flow\I18n\Cldr\Reader\DatesReader::parseCustomFormat