F
Filamentβ€’12mo 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');
}
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()
Jump to solution
1 Reply
Solution
Yaeger
Yaegerβ€’12mo ago
Nvm! Forgot to call $this->form->fill() in mount()
Want results from more Discord servers?
Add your server