Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RangeValidator.php

function RangeValidator::isParsableDatetimeString

1 call to RangeValidator::isParsableDatetimeString()
RangeValidator::validate in vendor/symfony/validator/Constraints/RangeValidator.php
Checks if the passed value is valid.

File

vendor/symfony/validator/Constraints/RangeValidator.php, line 170

Class

RangeValidator
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

private function isParsableDatetimeString(mixed $boundary) : bool {
    if (null === $boundary) {
        return true;
    }
    if (!\is_string($boundary)) {
        return false;
    }
    try {
        new \DateTimeImmutable($boundary);
    } catch (\Exception) {
        return false;
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal