DatePicker
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
No description
No description
Set the name of the field, if no label is set yet, this method will also update that.
Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
Marks the field as mandatory, however you still need to add validation rules.
No description
In render we dynamically build the constructor arguments.
Makes the field translatable.
Sets the placeholder of the field.
Hides the time picker.
Allows manual input.
Allows to clear the input field.
Makes it a time picker only.
If 24h format should be used.
If 24h format should be used.
Define a custom date format.
Set how many hours are increment when using the + and - actions.
Set how many minutes are increment when using the + and - actions.
Details
        
                            RenderForBlocks
    renderForBlocks(bool $renderForBlocks = true)
        
    
    No description
        
                            bool
    forBlocks()
        
    
    No description
        
                    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
        
                static            BaseFormField
    make()
        
    
    No description
        
                            BaseFormField
    name(string $name)
        
    
    Set the name of the field, if no label is set yet, this method will also update that.
        
                            BaseFormField
    default(mixed $default)
        
    
    No description
        
                            BaseFormField
    label(string $label)
        
    
    Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
        
                            BaseFormField
    note(string $note)
        
    
    Add a note to the field to display on the form.
        
                            BaseFormField
    required(bool $required = true)
        
    
    Marks the field as mandatory, however you still need to add validation rules.
        
                            BaseFormField
    disabled(bool $disabled = true)
        
    
    Marks the field as disabled.
There might be some fields not supporting this.
        
                            
    connectedTo(string $fieldName, mixed $fieldValues, array $options = [])
        
    
    No description
        
                            View
    render()
        
    
    No description
        
                    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.
        
                            IsTranslatable
    translatable(bool $translatable = true)
        
    
    Makes the field translatable.
        
                            HasPlaceholder
    placeholder(string $placeholder)
        
    
    Sets the placeholder of the field.
        
                            DatePicker
    withoutTime(bool $withoutTime = true)
        
    
    Hides the time picker.
        
                            DatePicker
    allowInput(bool $allowInput = true)
        
    
    Allows manual input.
        
                            DatePicker
    allowClear(bool $allowClear = true)
        
    
    Allows to clear the input field.
        
                            DatePicker
    timeOnly(bool $timeOnly = true)
        
    
    Makes it a time picker only.
        
                            DatePicker
    time24h(bool $time24h = true)
        
    
    If 24h format should be used.
        
                            DatePicker
    time24hr(bool $time24hr = true)
        
    
    If 24h format should be used.
Added for docs and backwards compatibility
        
                            DatePicker
    altFormat(string $altFormat)
        
    
    Define a custom date format.
        
                            DatePicker
    hourIncrement(int $hourIncrement = 1)
        
    
    Set how many hours are increment when using the + and - actions.
        
                            DatePicker
    minuteIncrement(int $minuteIncrement = 1)
        
    
    Set how many minutes are increment when using the + and - actions.