1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119:
<?php
/**
* MvcCore
*
* This source file is subject to the BSD 3 License
* For the full copyright and license information, please view
* the LICENSE.md file that are distributed with this source code.
*
* @copyright Copyright (c) 2016 Tom Flidr (https://github.com/mvccore)
* @license https://mvccore.github.io/docs/mvccore/5.0.0/LICENCE.md
*/
namespace MvcCore\Ext\Forms\Fields;
/**
* Responsibility: define getters and setters for field properties: `min`,
* `max` and `step`, for fields with type `date` and extended
* field types from `date` type.
* Interface 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`
* - `\MvcCore\Ext\Forms\Validators\Date`
*/
interface IMinMaxStepDates {
/**
* 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";`)
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min
* @param bool $getFormatedString Get value as formatted string by `$this->format`.
* @return \DateTimeInterface|string|NULL
*/
public function GetMin ($getFormatedString = FALSE);
/**
* 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";`)
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min
* @param \DateTimeInterface|string|int $min
* @return \MvcCore\Ext\Forms\Field
*/
public function SetMin ($min);
/**
* 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";`)
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max
* @param bool $getFormatedString Get value as formatted string by `$this->format`.
* @return \DateTimeInterface|string|NULL
*/
public function GetMax ($getFormatedString = FALSE);
/**
* 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";`)
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max
* @param \DateTimeInterface|string|int $max
* @return \MvcCore\Ext\Forms\Field
*/
public function SetMax ($max);
/**
* 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...
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
* @return int|NULL
*/
public function GetStep ();
/**
* 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...
* @see https://www.wufoo.com/html5/date-type/
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step
* @param int $step
* @return \MvcCore\Ext\Forms\Field
*/
public function SetStep ($step);
}