class DatePicker extends BaseFormField (View source)

Traits

Properties

bool $renderForBlocks from  RenderForBlocks
protected bool $translated from  IsTranslatable
protected string|null $placeholder from  HasPlaceholder
protected bool $withTime
protected bool $allowInput
protected bool $allowClear
protected bool $timeOnly
protected bool $time24Hr
protected string|null $altFormat
protected int|null $minuteIncrement
protected int|null $hourIncrement

Methods

renderForBlocks(bool $renderForBlocks = true)

No description

bool
forBlocks()

No description

__construct(string $component, string|null $name = null, string|null $label = null, string|null $note = null, bool|null $required = false, bool|null $disabled = false, mixed $default = null, mixed $connectedTo = null, array $mandatoryProperties = [])

No description

static BaseFormField
make()

No description

name(string $name)

Set the name of the field, if no label is set yet, this method will also update that.

default(mixed $default)

No description

label(string $label)

Set the label of the field, you can use twillTrans('') Laravel translatable strings here.

note(string $note)

Add a note to the field to display on the form.

required(bool $required = true)

Marks the field as mandatory, however you still need to add validation rules.

disabled(bool $disabled = true)

Marks the field as disabled.

connectedTo(string $fieldName, mixed $fieldValues, array $options = [])

No description

View
render()

No description

array
getAdditionalConstructorArguments()

In render we dynamically build the constructor arguments.

translatable(bool $translatable = true)

Makes the field translatable.

placeholder(string $placeholder)

Sets the placeholder of the field.

withoutTime(bool $withoutTime = true)

Hides the time picker.

allowInput(bool $allowInput = true)

Allows manual input.

allowClear(bool $allowClear = true)

Allows to clear the input field.

timeOnly(bool $timeOnly = true)

Makes it a time picker only.

time24h(bool $time24h = true)

If 24h format should be used.

time24hr(bool $time24hr = true)

If 24h format should be used.

altFormat(string $altFormat)

Define a custom date format.

hourIncrement(int $hourIncrement = 1)

Set how many hours are increment when using the + and - actions.

minuteIncrement(int $minuteIncrement = 1)

Set how many minutes are increment when using the + and - actions.

Details

RenderForBlocks renderForBlocks(bool $renderForBlocks = true)

No description

Parameters

bool $renderForBlocks

Return Value

RenderForBlocks

bool forBlocks()

No description

Return Value

bool

protected __construct(string $component, string|null $name = null, string|null $label = null, string|null $note = null, bool|null $required = false, bool|null $disabled = false, mixed $default = null, mixed $connectedTo = null, array $mandatoryProperties = [])

No description

Parameters

string $component
string|null $name
string|null $label
string|null $note
bool|null $required
bool|null $disabled
mixed $default
mixed $connectedTo
array $mandatoryProperties

static BaseFormField make()

No description

Return Value

BaseFormField

BaseFormField name(string $name)

Set the name of the field, if no label is set yet, this method will also update that.

Parameters

string $name

Return Value

BaseFormField

BaseFormField default(mixed $default)

No description

Parameters

mixed $default

Return Value

BaseFormField

BaseFormField label(string $label)

Set the label of the field, you can use twillTrans('') Laravel translatable strings here.

Parameters

string $label

Return Value

BaseFormField

BaseFormField note(string $note)

Add a note to the field to display on the form.

Parameters

string $note

Return Value

BaseFormField

BaseFormField required(bool $required = true)

Marks the field as mandatory, however you still need to add validation rules.

Parameters

bool $required

Return Value

BaseFormField

BaseFormField disabled(bool $disabled = true)

Marks the field as disabled.

There might be some fields not supporting this.

Parameters

bool $disabled

Return Value

BaseFormField

connectedTo(string $fieldName, mixed $fieldValues, array $options = [])

No description

Parameters

string $fieldName
mixed $fieldValues
array $options

View render()

No description

Return Value

View

protected array getAdditionalConstructorArguments()

In render we dynamically build the constructor arguments.

In exceptional cases such as browser we have more conditionals and we can use this method to set those.

Return Value

array

IsTranslatable translatable(bool $translatable = true)

Makes the field translatable.

Parameters

bool $translatable

Return Value

IsTranslatable

HasPlaceholder placeholder(string $placeholder)

Sets the placeholder of the field.

Parameters

string $placeholder

Return Value

HasPlaceholder

DatePicker withoutTime(bool $withoutTime = true)

Hides the time picker.

Parameters

bool $withoutTime

Return Value

DatePicker

DatePicker allowInput(bool $allowInput = true)

Allows manual input.

Parameters

bool $allowInput

Return Value

DatePicker

DatePicker allowClear(bool $allowClear = true)

Allows to clear the input field.

Parameters

bool $allowClear

Return Value

DatePicker

DatePicker timeOnly(bool $timeOnly = true)

Makes it a time picker only.

Parameters

bool $timeOnly

Return Value

DatePicker

DatePicker time24h(bool $time24h = true)

If 24h format should be used.

Parameters

bool $time24h

Return Value

DatePicker

DatePicker time24hr(bool $time24hr = true)

If 24h format should be used.

Added for docs and backwards compatibility

Parameters

bool $time24hr

Return Value

DatePicker

DatePicker altFormat(string $altFormat)

Define a custom date format.

Parameters

string $altFormat

Return Value

DatePicker

DatePicker hourIncrement(int $hourIncrement = 1)

Set how many hours are increment when using the + and - actions.

Parameters

int $hourIncrement

Return Value

DatePicker

DatePicker minuteIncrement(int $minuteIncrement = 1)

Set how many minutes are increment when using the + and - actions.

Parameters

int $minuteIncrement

Return Value

DatePicker