You are here

public function DatexPoorMansGregorianCalendar::parse in Datex 8

Overrides DatexInterface::parse

File

src/Datex/DatexPoorMansGregorianCalendar.php, line 52
Fallback calendar implementation in case php-intl is not available.

Class

DatexPoorMansGregorianCalendar

Namespace

Drupal\datex\Datex

Code

public function parse($value, $format) {
  $dt = \DateTime::createFromFormat($format, $value);
  if (!$dt) {
    return FALSE;
  }
  $this
    ->setTimestamp($dt
    ->getTimestamp());
  return TRUE;
}