class DateTimeControl extends BaseControl

Selects date or time or date & time.

Constants

TypeDate

TypeTime

TypeDateTime

FormatObject

FormatTimestamp

Methods

__construct(string|Stringable|null $label = null, int $type = self::TypeDate, bool $withSeconds = false)

No description

setFormat(string $format)

Format of returned value. Allowed values are string (ie 'Y-m-d'), DateTimeControl::FormatObject and DateTimeControl::FormatTimestamp.

setValue(mixed $value)

No description

mixed
getValue()

Returns control's value.

void
loadHttpData()

Loads HTTP data.

Html|string
getControl()

Generates control's HTML element.

string
formatHtmlValue(DateTimeInterface|string|int $value)

Formats a date/time for HTML attributes.

string
formatLocaleText(DateTimeInterface|string|int $value)

Formats a date/time according to the locale and formatting options.

bool
validateMinMax(mixed $min, mixed $max)

No description

Details

at line 36
__construct(string|Stringable|null $label = null, int $type = self::TypeDate, bool $withSeconds = false)

No description

Parameters

string|Stringable|null $label
int $type
bool $withSeconds

at line 52
DateTimeControl setFormat(string $format)

Format of returned value. Allowed values are string (ie 'Y-m-d'), DateTimeControl::FormatObject and DateTimeControl::FormatTimestamp.

Parameters

string $format

Return Value

DateTimeControl

at line 62
Control setValue(mixed $value)

No description

Parameters

mixed $value

Return Value

Control

at line 71
mixed getValue()

Returns control's value.

Return Value

mixed

at line 102
void loadHttpData()

Loads HTTP data.

Return Value

void

at line 112
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 127
string formatHtmlValue(DateTimeInterface|string|int $value)

Formats a date/time for HTML attributes.

Parameters

DateTimeInterface|string|int $value

Return Value

string

at line 140
string formatLocaleText(DateTimeInterface|string|int $value)

Formats a date/time according to the locale and formatting options.

Parameters

DateTimeInterface|string|int $value

Return Value

string

at line 173
bool validateMinMax(mixed $min, mixed $max)

No description

Parameters

mixed $min
mixed $max

Return Value

bool