Trait for classes:
- \MvcCore\Ext\Forms\Fields\Date - \MvcCore\Ext\Forms\Fields\DateTime - \MvcCore\Ext\Forms\Fields\Month - \MvcCore\Ext\Forms\Fields\Time - \MvcCore\Ext\Forms\Fields\Week
Trait contains properties, getters and setters for
protected properties min, max and step.
Methods summary
public
DateTimeInterface|string|null
|
#
GetMin( boolean $getFormatedString = FALSE )
Get minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
Get minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
Parameters
- $getFormatedString
- Get value as formatted string by
$this->format.
Returns
DateTimeInterface|string|null
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min
|
public
MvcCore\Ext\Forms\Field
|
#
SetMin( DateTimeInterface|string|integer $min )
Set minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
Set minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
Parameters
Returns
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min
|
public
DateTimeInterface|string|null
|
#
GetMax( boolean $getFormatedString = FALSE )
Get maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
Get maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
Parameters
- $getFormatedString
- Get value as formatted string by
$this->format.
Returns
DateTimeInterface|string|null
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max
|
public
MvcCore\Ext\Forms\Field
|
#
SetMax( DateTimeInterface|string|integer $max )
Set maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
Set maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
Parameters
Returns
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max
|
public
integer|null
|
#
GetStep( )
Get step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
Get step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
Returns
integer|null
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
|
public
MvcCore\Ext\Forms\Field
|
#
SetStep( integer $step )
Set step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
Set step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
Parameters
Returns
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
|
protected
DateTimeInterface|null
|
#
createDateTimeFromInput( DateTimeInterface|integer|string $inputValue, $throwException = FALSE )
Create \DateTimeInterface value from given \DateTimeInterface
or from given int (UNIX timestamp) or from string value
(formatted by date() with $this->format) and return it.
Create \DateTimeInterface value from given \DateTimeInterface
or from given int (UNIX timestamp) or from string value
(formatted by date() with $this->format) and return it.
Parameters
- $inputValue
- $throwException
Returns
DateTimeInterface|null
See
http://php.net/manual/en/class.datetime.php
|
Properties summary
protected
DateTimeInterface|null
|
$min
Minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
Minimum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2017-01-01" (with $field->format = "Y-m-d";)
-Time => "14:00"(with$field->format= "H:i";)
- DateTime => "2017-01-01 14:00" (with $field->format = "Y-m-d H:i";)
-Week => "2017-W01"(with$field->format= "o-\WW";)
- Month => "2017-01" (with $field->format = "Y-m";`)
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min
|
|
protected
DateTimeInterface|null
|
$max
Maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
Maximum value for Date, Time, DateTime, Week
and Month field(s) in string value.
Example string values for date and time fields:
- Date => "2018-06-24" (with $field->format = "Y-m-d";)
-Time => "20:00"(with$field->format= "H:i";)
- DateTime => "2018-06-24 20:00" (with $field->format = "Y-m-d H:i";)
-Week => "2018-W25"(with$field->format= "o-\WW";)
- Month => "2018-06" (with $field->format = "Y-m";`)
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max
|
|
protected
integer|null
|
$step
Step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
Step value for Date, Time, DateTime, Week
and Month fields, always in integer.
For Date and DateTime fields, step is int, number of days.
For Time fields, step is int, number of seconds.
For Week and Month fields, step is int, number of weeks or months...
See
https://www.wufoo.com/html5/date-type/
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
|
|