Change state before dehydration

For context, i have a DateTimePicker component for selecting the event's start date. If the user marks the all_day checkbox, i need the component to set the hour to 00:00:00 but keeping the date. eg: 28/07/2023 -> 28/07/2023 00:00:00.

The thing is: I know i can do this with ->dehydrateStateUsing() but this will override the default dehydration process, which i need because it handles the timezone stuff behind the scenes..

How can i mutate the state before the dehydration process?
Solution
Filament already have a ->beforeStateDehydrated()
Was this page helpful?