You are here

protected function DateArgumentWrapper::getYearWeek in Calendar 8

1 call to DateArgumentWrapper::getYearWeek()
DateArgumentWrapper::validateValue in src/DateArgumentWrapper.php
Check if a string value is valid for this format.

File

src/DateArgumentWrapper.php, line 254

Class

DateArgumentWrapper
The DateArgumentWrapper class.

Namespace

Drupal\calendar

Code

protected function getYearWeek($value) {
  if (is_numeric($value) && strlen($value) == 6) {
    $return['year'] = (int) substr($value, 0, 4);
    $return['week'] = (int) substr($value, 4, 2);
    return $return;
  }
  return FALSE;
}