Disable Previous Dates in End Date Picker - User Should Not Select Before Release Date
I'm trying to disable dates in the end_date picker so that users cannot select any date before the release_date using Filament's DatePicker. Here's what I have so far:
Forms\Components\DatePicker::make('release_date')
->required()
->reactive()
->afterStateUpdated(function (Set $set, Get $get, $state, string $operation) {
$releaseDate = Carbon::parse($state);
// Update the minimum date for the end_date based on the selected release_date
$set('release_date_min', $releaseDate);
}),
Forms\Components\DatePicker::make('end_date')
->required(),
What I'm trying to achieve:
Users should only be able to select an end_date that is equal to or after the release_date.
P
How can I properly disable dates in the end_date picker that are earlier than the release_date?
Thanks for any help or insights!
Forms\Components\DatePicker::make('release_date')
->required()
->reactive()
->afterStateUpdated(function (Set $set, Get $get, $state, string $operation) {
$releaseDate = Carbon::parse($state);
// Update the minimum date for the end_date based on the selected release_date
$set('release_date_min', $releaseDate);
}),
Forms\Components\DatePicker::make('end_date')
->required(),
What I'm trying to achieve:
Users should only be able to select an end_date that is equal to or after the release_date.
P
How can I properly disable dates in the end_date picker that are earlier than the release_date?
Thanks for any help or insights!
