diff --git a/packages/forms/docs/03-fields.md b/packages/forms/docs/03-fields.md index 9b0db6d55a..32f8f87ca3 100644 --- a/packages/forms/docs/03-fields.md +++ b/packages/forms/docs/03-fields.md @@ -1142,7 +1142,10 @@ To disable specific dates: use Filament\Forms\Components\DateTimePicker; DateTimePicker::make('date') - ->icon('heroicon-o-calendar') + ->label('Appointment date') + ->minDate(now()) + ->maxDate(Carbon::now()->addDays(30)) + ->disabledDates(['2022-10-02', '2022-10-05', '2022-10-15']) ``` The calendar icon can be changed, or disabled by passing `icon(false)` diff --git a/packages/forms/resources/views/components/date-time-picker.blade.php b/packages/forms/resources/views/components/date-time-picker.blade.php index 7ef341ed40..1ea8b8c79a 100644 --- a/packages/forms/resources/views/components/date-time-picker.blade.php +++ b/packages/forms/resources/views/components/date-time-picker.blade.php @@ -1,6 +1,7 @@ @php $icon = $getIcon(); @endphp + $isDisabled(), 'dark:text-gray-300' => $isDisabled() && config('forms.dark_mode'), 'px-3' => ! $icon, - 'pl-3 pr-10 rtl:pl-10 rtl:pr-3' => $icon, + 'pl-3 pr-10 rtl:pl-10 rtl:pr-3' => $icon || $icon === null, ]) }} > - @if ($icon) - - @if ($icon === 'default') - config('forms.dark_mode'), - ]) xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> + @if ($icon || $icon === null) + + @if ($icon === null) + config('forms.dark_mode'), + ]) + > @else config('forms.dark_mode'), - ]) /> + 'w-5 h-5 text-gray-400 hover:text-gray-800 focus:text-primary-600', + 'dark:text-gray-400 dark:hover:text-gray-200 dark:focus:text-primary-600' => config('forms.dark_mode'), + ]) + /> @endif @endif @@ -229,7 +237,6 @@ ]) >: -