datepicker state update

                          Forms\Components\DatePicker::make('plan_started')
                                ->afterStateUpdated(function (Closure $set, Closure $get, $state) {
                                    $state = Carbon::parse($state);
                                    $set('plan_expires', $get('plan_term') == 'year' ? $state->addYear() : $state->addMonth());
                                })->format('Y-m-d')
                                ->displayFormat('d-m-Y'),
                            Forms\Components\DatePicker::make('plan_expires')
                                ->disabled()
                                ->format('Y-m-d')
                                ->displayFormat('d-m-Y') 

i want to select a date in 'plan_started' datepicker and using that date for 'plan_expires'. in filament v2 i used this code and works like i wanted. in v3 it is not works.i look at changes and see the 'closure' was changed to 'Set' and 'Get' but still i could not succeed. how should i change the codes ? thanks
Was this page helpful?