Saade
Bind $record in a custom action
Giving the following component:
How can i make the repeater know that the record is the $record resolved on mount?
Made a little repro repo with everything set up, no need for migrations and seeders
https://github.com/saade/filament-lab/tree/action-record
70 replies
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?28 replies
DatePicker creating records wrongly but editing correctly
I have an app configured with
UTC
timezone, and form with the following date picker (DATE ONLY, no time):
If i select 2023-03-09
in the form, it CREATES in the database as 2023-03-09
(wrong, it should save as D-1)
If i view the record, it will show as 2023-03-08
(wrong, because of timezone)
Then i edit this date back to 2023-03-09
and it UPDATES to 2023-03-10
(correct, D-1)
If i view the record, it will show as 2023-03-09
(which is now correct)
WTF is going on? Am i dumb and don't know how timezone works?20 replies