How to clear DateTimePicker field?

Does anyone know if there’s a good way to clear the DateTimePicker field please? Native or non native, I don’t have a clear button anywhere! Thanks
4 Replies
toeknee
toeknee2mo ago
How do you want to clear it? You can just run $set('DateTimePickerFieldName', null) ?
stevecrossuk
stevecrossukOP2mo ago
@toeknee do you mean on an action?
LeandroFerreira
LeandroFerreira2mo ago
I think there is a clear button in native. You could also use a hint action
DateTimePicker::make('date')
->hintAction(\Filament\Forms\Components\Actions\Action::make('clear')
->action(fn (DateTimePicker $component) => $component->state(null)))
DateTimePicker::make('date')
->hintAction(\Filament\Forms\Components\Actions\Action::make('clear')
->action(fn (DateTimePicker $component) => $component->state(null)))
@stevecrossuk
stevecrossuk
stevecrossukOP2mo ago
Thanks @LeandroFerreira I really appreciate your help
Want results from more Discord servers?
Add your server