FilamentF
Filament2y ago
Abi

DatePicker not disabling dates outside of min and max dates

I have the following code to create a DatePicker for Table Filter

$minDate = Carbon::parse('12/26/2023');
$minDate = Carbon::parse('12/28/2023');
DatePicker::make('created_from')
    ->default(Carbon::now())
    ->minDate($minDate)
    ->maxDate($maxDate),

but the dates outside of min and max dates don't seem to be disabled. Am I missing something here?
Solution
POC:
Forms\Components\DatePicker::make('poc_date')
    ->minDate(now()->startOfMonth()->addDay())
    ->maxDate(now()->endOfMonth()->subDay())
    ->disabledDates(['2023-12-9', '2023-12-10'])
    ->native(false),

will get you this:
Was this page helpful?