DateTimeControl
class DateTimeControl extends BaseControl
Date, time, or date-time input returning DateTimeImmutable (or string/timestamp based on format).
Constants
| TypeDate |
|
| TypeTime |
|
| TypeDateTime |
|
| FormatObject |
|
| FormatTimestamp |
|
Methods
No description
Format of returned value. Allowed values are string (ie 'Y-m-d'), DateTimeControl::FormatObject and DateTimeControl::FormatTimestamp.
No description
No description
No description
Formats a date/time for HTML attributes.
Formats a date/time according to the locale and formatting options.
Checks whether the control's value falls within the given date/time range.
Details
at line 35
__construct(string|Stringable|null $label = null, int $type = self::TypeDate, bool $withSeconds = false)
No description
at line 49
DateTimeControl
setFormat(string $format)
Format of returned value. Allowed values are string (ie 'Y-m-d'), DateTimeControl::FormatObject and DateTimeControl::FormatTimestamp.
at line 59
DateTimeControl
setValue(DateTimeInterface|string|int|null $value)
No description
at line 68
DateTimeImmutable|string|int|null
getValue()
No description
at line 99
void
loadHttpData()
No description
at line 109
Html
getControl()
No description
at line 124
string
formatHtmlValue(DateTimeInterface|string|int $value)
Formats a date/time for HTML attributes.
at line 137
string
formatLocaleText(DateTimeInterface|string|int $value)
Formats a date/time according to the locale and formatting options.
at line 175
bool
validateMinMax(mixed $min, mixed $max)
Checks whether the control's value falls within the given date/time range.
For TypeTime, wraps around midnight (e.g. 22:00–02:00) if min > max.