class DateTimeInput extends TextInput

Class DateTimeInput. Textual datetime input.

Traits

Trait StandardValidationTrait.

Constants

DEFAULT_FORMAT

Properties

string $placeholder HTML placeholder from  TextInput
bool $autocomplete from  TextInput
string $invalidFormatMessage This errorMessage is added for invalid format
string $format expected PHP format for datetime

Methods

Html
showValidation( Html $control)

Modify control in such a way that it explicitly shows its validation state.

__construct($label = NULL, $maxLength = NULL)

No description

bool|null
getAutocomplete($bool)

Gets the state of autocomplete: true=on,false=off,null=omit attribute

setAutocomplete(bool|null $bool)

Turns autocomplete on or off.

getControl()

No description

string
getPlaceholder()

No description

setPlaceholder(string $placeholder)

No description

cleanErrors()

No description

getValue()

No description

setValue( DateTime|null $value)

No description

validate()

No description

string
getFormat()

No description

setFormat(string $format, null|string $placeholder = NULL)

Input accepted format.

static string
makeFormatPlaceholder(string $format, bool $example = TRUE, bool $appendExample = TRUE)

Turns datetime format into a placeholder, e.g. 'd.m.Y' => 'dd.mm.yyyy'.

Details

Html showValidation( Html $control)

Modify control in such a way that it explicitly shows its validation state.

Returns the modified element.

Parameters

Html $control

Return Value

Html

at line 43
__construct($label = NULL, $maxLength = NULL)

Parameters

$label
$maxLength

in TextInput at line 55
bool|null getAutocomplete($bool)

Gets the state of autocomplete: true=on,false=off,null=omit attribute

Parameters

$bool

Return Value

bool|null

in TextInput at line 65
IAutocompleteInput setAutocomplete(bool|null $bool)

Turns autocomplete on or off.

Parameters

bool|null $bool null to omit attribute (default)

Return Value

IAutocompleteInput

in TextInput at line 78
getControl()

in TextInput at line 98
string getPlaceholder()

Return Value

string

See also

in TextInput at line 108
TextInput setPlaceholder(string $placeholder)

Parameters

string $placeholder

Return Value

TextInput

See also

at line 60
cleanErrors()

at line 68
getValue()

at line 87
DateTimeInput setValue(DateTime |null $value)

Parameters

DateTime|null $value

Return Value

DateTimeInput

at line 113
validate()

at line 123
string getFormat()

Return Value

string

See also

at line 135
DateTimeInput setFormat(string $format, null|string $placeholder = NULL)

Input accepted format.

Default is d.m.yyyy h:mm

Parameters

string $format
null|string $placeholder

Return Value

DateTimeInput

at line 157
static string makeFormatPlaceholder(string $format, bool $example = TRUE, bool $appendExample = TRUE)

Turns datetime format into a placeholder, e.g. 'd.m.Y' => 'dd.mm.yyyy'.

Supported values: d, j, m, n, Y, y, a, A, g, G, h, H, i, s, c, U

Parameters

string $format
bool $example whether to use e.g. 'd' or '01'
bool $appendExample attach example at the end of placeholder (true) or replace (false)e?

Return Value

string