IsDateWithinRange
extends IsDate
in package
Requires a date within a specified range.
Table of Contents
Properties
Methods
- __construct() : mixed
- getRange() : DateRange
- isValid() : bool
- Returns true if validation is successful
- setFormat() : $this
- setRange() : $this
- validate() : bool
- Abstract method to be implemented by all validators.
Properties
$_format
private
string
$_format
= 'Y-m-d'
$_range
private
DateRange
$_range
Methods
__construct()
public
__construct(DateRange $range) : mixed
Parameters
- $range : DateRange
getRange()
public
getRange() : DateRange
Return values
DateRangeisValid()
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
$thissetRange()
public
setRange(DateRange $range) : $this
Parameters
- $range : DateRange
Return values
$thisvalidate()
Abstract method to be implemented by all validators.
protected
validate(mixed $value) : bool
Parameters
- $value : mixed