You are here

public static function OfficeHoursDatetime::validateOfficeHoursTime in Office Hours 8

Validate the hours selector element.

Parameters

$element:

\Drupal\Core\Form\FormStateInterface $form_state:

$complete_form:

File

src/Element/OfficeHoursDatetime.php, line 99

Class

OfficeHoursDatetime
Provides a one-line HTML5 time element.

Namespace

Drupal\office_hours\Element

Code

public static function validateOfficeHoursTime(&$element, FormStateInterface $form_state, &$complete_form) {
  $input_exists = FALSE;

  // @todo Call validateDatetime().
  // Get the 'time' sub-array.
  $input = NestedArray::getValue($form_state
    ->getValues(), $element['#parents'], $input_exists);

  // Generate the 'object' sub-array.
  parent::valueCallback($element, $input, $form_state);
}