You are here

public function HMSService::isValid in HMS Field 8

Validate hms field input.

Parameters

integer $input:

string $format:

Return value

boolean

Overrides HMSServiceInterface::isValid

File

src/HMSService.php, line 318

Class

HMSService
Provides a service to handle various hms related functionality.

Namespace

Drupal\hms_field

Code

public function isValid($input, $format, $element = [], $format_state = []) {
  if ($this
    ->formatted_to_seconds($input, $format, $element, $format_state) !== FALSE) {
    return TRUE;
  }
  return FALSE;
}