FilamentF
Filamentβ€’3y ago
Yaeger

Set default value of DateTimePicker

Hi I am trying to prefill a DateTimePicker with a predefined value. I tried this but it doesn't work:

public function form(Form $form): Form
{
    return $form
        ->schema([
            DateTimePicker::make('date')
                ->default(now())
                ->seconds(false)
                ->required()
        ])
        ->statePath('data');
}


The input is still empty. Probably something easy but I can't figure it out. Thanks 😁
Solution
Nvm! Forgot to call $this->form->fill() in mount()
Was this page helpful?