malzariey / filament-daterangepicker-filter

MIT License
105 stars 46 forks source link

Cannot inject $record or $operation inside startDate #128

Open michele-grifa opened 2 weeks ago

michele-grifa commented 2 weeks ago

I want add some logic to the startDate function, based on the operation, but when I load the resource page, I get the error:

Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
DateRangePicker::make('data')
                ->startDate(function ($record, string $operation) {
                    //
                })
                ->firstDayOfWeek(1)
                ->drops(DropDirection::AUTO)
                ->autoApply(),