Class Date
Responsibility: Validate submitted date format, min., max., step and remove dangerous characters.
- MvcCore\Ext\Forms\Validator implements MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\Date implements MvcCore\Ext\Forms\Fields\IMinMaxStepDates uses MvcCore\Ext\Forms\Field\Props\Format, MvcCore\Ext\Forms\Field\Props\MinMaxStepDates
Direct known subclasses
MvcCore\Ext\Forms\Validators\DateTime, MvcCore\Ext\Forms\Validators\Month, MvcCore\Ext\Forms\Validators\Time, MvcCore\Ext\Forms\Validators\WeekLocated at ext-form-field-date/src/MvcCore/Ext/Forms/Validators/Date.php
public
|
#
SetField(
Set up field instance, where is validated value by this
validator during submit before every |
public
string|array|null
|
|
protected
DateTimeInterface
|
|
protected
DateTimeInterface
|
CreateInstance(),
GetErrorMessage(),
SetForm(),
__construct(),
setUpFieldProps(),
throwNewInvalidArgumentException()
|
GetMax(),
GetMin(),
GetStep(),
SetMax(),
SetMin(),
SetStep()
|
GetFormat(),
SetFormat()
|
GetMax(),
GetMin(),
GetStep(),
SetMax(),
SetMin(),
SetStep(),
createDateTimeFromInput()
|
integer |
ERROR_DATE_INVALID
Error message index(es). |
#
0
|
integer |
ERROR_DATE_TO_LOW
|
#
1
|
integer |
ERROR_DATE_TO_HIGH
|
#
2
|
integer |
ERROR_DATE_STEP
|
#
3
|
protected static
array
|
$errorMessages
Validation failure message template definitions. |
#
[
self::ERROR_DATE_INVALID => "Field '{0}' requires a valid date format: '{1}'.",
self::ERROR_DATE_TO_LOW => "Field '{0}' requires date higher or equal to '{1}'.",
self::ERROR_DATE_TO_HIGH => "Field '{0}' requires date lower or equal to '{1}'.",
self::ERROR_DATE_STEP => "Field '{0}' requires date in predefined days interval '{1}' from start point '{2}'.",
]
|
protected static
array
|
$fieldSpecificProperties
Field specific values (camel case) and their validator default values. |
#
[
'min' => NULL,
'max' => NULL,
'step' => NULL,
'format' => NULL,
]
|
protected
string
|
$format
String format mask to format given values in |
#
NULL
|
protected static
array
|
$errorMessagesFormatReplacements
Error messages replacements. How to get more human form shortcuts from
PHP |
#
[
'd' => 'DD',
'j' => 'D',
'D' => 'Mon-Sun',
'l' => 'Monday-Sunday',
'm' => 'MM',
'n' => 'M',
'M' => 'Jan-Dec',
'F' => 'January-December',
'Y' => 'YYYY',
'y' => 'YY',
'a' => 'am/pm',
'A' => 'AM/PM',
'g' => '1-12',
'h' => '01-12',
'G' => '01-12',
'H' => '00-23',
'i' => '00-59',
's' => '00-59',
'u' => '0-999999',
]
|
$field,
$form,
$toolClass
|
$max,
$min,
$step
|