IsDateTime
extends Base
in package
Requires a date with a specific format. Defaults to Y-m-d
Table of Contents
Properties
- $_format : string
Methods
- __construct() : mixed
- isValid() : bool
- Returns true if validation is successful
- setFormat() : $this
- validate() : bool
- Abstract method to be implemented by all validators.
Properties
$_format
private
string
$_format
= 'Y-m-d H:i:s'
Methods
__construct()
public
__construct() : mixed
isValid()
Returns true if validation is successful
public
isValid(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolsetFormat()
public
setFormat(mixed $format) : $this
Parameters
- $format : mixed
-
- Specify the date format to validate to. Defaults to Y-m-d
Return values
$thisvalidate()
Abstract method to be implemented by all validators.
protected
validate(mixed $value) : bool
Parameters
- $value : mixed