DatetimeFieldValidator
class DatetimeFieldValidator extends DateFieldValidator (View source)
Validates that a value is a valid date/time, which means that it follows the equivalent formats:
- PHP date format Y-m-d H:i:s
- ISO format 'y-MM-dd HH:mm:ss' i.e. DBDateTime::ISO_DATETIME
Blank string values are allowed
Properties
protected | string | $name | The name of the field being validated |
from FieldValidator |
protected | mixed | $value | The value to validate |
from FieldValidator |
protected | bool | $allowNull | Whether null is considered a valid value |
from FieldValidator |
Methods
public
__construct(string $name, mixed $value, string|null $minValue = null, string|null $maxValue = null, callable|null $converter = null)
No description
from
DateFieldValidator
protected
validateValue()
Inner validation method that performs the actual validation logic
from
DateFieldValidator
Details
__construct(string $name, mixed $value, string|null $minValue = null, string|null $maxValue = null, callable|null $converter = null)
No description
ValidationResult
validate()
Validate the value
protected ValidationResult
validateValue()
Inner validation method that performs the actual validation logic
protected string
getFormat()
No description
protected string
getMessage()
No description