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
toeknee4w ago
How do you want to clear it? You can just run $set('DateTimePickerFieldName', null) ?
stevecrossuk
stevecrossukOP4w ago
@toeknee do you mean on an action?
LeandroFerreira
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
stevecrossukOP3w ago
Thanks @LeandroFerreira I really appreciate your help
Want results from more Discord servers?
Add your server