Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Laravel does not prescribe a single date-picker API: the code depends on the component and version your app uses. In Filament, use minDate() for the earliest allowed date and disabledDates() for dates users cannot select. With Flatpickr, use minDate, disable, and dateFormat; altInput and altFormat let the displayed date differ from the submitted value. Identify your installed picker before copying either example.

Identify the date picker before changing its settings

Laravel applications may use Filament, Flatpickr, or another form component. Their option names and date-format tokens are not interchangeable. Check your project’s dependencies and the documentation for the installed package version. The examples below are labeled by library; Filament’s linked documentation is for version 5.x, while the minimum-date code example is from its 3.x documentation, so verify it against your installation.

Filament’s date-time picker documentation shows date limits and disabled dates. Flatpickr documents its settings in its examples and options reference.

Set a minimum date in Filament

Use minDate() to set the earliest selectable date. You can also set maxDate() for the latest date. Filament’s documentation accepts a date value such as a DateTime instance or a string. This example follows the Filament 3.x documentation; confirm compatibility with your installed version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
use FilamentFormsComponentsDatePicker;

DatePicker::make('date_of_birth')
    ->native(false)
    ->minDate(now()->subYears(150))
    ->maxDate(now());

native(false) selects Filament’s JavaScript picker rather than the browser’s native date control. The example makes dates from 150 years ago through today selectable; adjust those bounds to suit your application.

Set a minimum date in Flatpickr

Flatpickr’s minDate is inclusive: the boundary date itself remains selectable. Its date options accept JavaScript Date objects, timestamps, ISO strings, strings matching the configured dateFormat, and the shortcut today. For example:

flatpickr('#appointment-date', {
  minDate: 'today'
});

This uses Flatpickr’s default date format for parsing unless you configure another one. If you pass a string in a custom format, make sure it matches the picker’s dateFormat.

Disable specific dates or date rules

Filament: disable a static list

Filament documents disabledDates() for dates users must not select. Its example uses a JavaScript picker and a list of date strings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
DateTimePicker::make('date')
    ->native(false)
    ->disabledDates(['2000-01-03', '2000-01-15', '2000-01-20']);

Those dates illustrate the syntax; replace them with dates relevant to your application. For availability that changes, Filament’s current documentation also describes a function form. Check the installed version’s callback and utility-injection requirements before using it.

Flatpickr: disable dates, ranges, or matching days

Flatpickr’s disable option supports individual dates, ranges, and a function that returns true for a date that should be disabled. The documentation demonstrates disabling weekends with a function:

flatpickr('#appointment-date', {
  disable: [
    function (date) {
      return date.getDay() === 0 || date.getDay() === 6;
    }
  ]
});

Here, getDay() returns 0 for Sunday and 6 for Saturday. For a fixed list or range, use the date or range forms shown in the Flatpickr examples. Use a callback when the rule depends on a recurring condition, such as the day of the week.

Choose the submitted and displayed date formats

Flatpickr: keep a server-friendly value and show a readable date

Flatpickr’s dateFormat controls the value in the original input; its options reference lists Y-m-d as the default. To show a more readable date while retaining a distinct original-input value, enable altInput and set altFormat:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
flatpickr('#appointment-date', {
  dateFormat: 'Y-m-d',
  altInput: true,
  altFormat: 'F j, Y'
});

In this example, the original input uses a year-month-day value while the alternate input displays a month name and day. Flatpickr’s ariaDateFormat controls the day labels announced by assistive technology and uses the same token family as dateFormat. See the Flatpickr options reference for the available settings.

Filament and integrations: check the component’s token rules

Do not assume Flatpickr’s format tokens work in Filament methods. A third-party Filament integration, for example, shows format('Y-m-d') and displayFormat('F Y'); that is guidance for the Coolsam Flatpickr plugin, not a universal Filament API. Follow the format rules for your exact component or plugin.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate the value your application receives

A picker setting controls the interface, but your application should also validate incoming dates against the rules that matter to your data. Confirm that the submitted value uses the format your server expects, particularly when the visible input uses an alternate display format. This protects the application if a request does not follow the picker’s interface.

  • Check the field’s actual submitted value in the browser or request payload.
  • Confirm that server-side parsing and validation use the submitted format, not merely the human-readable display format.
  • Test the lower boundary itself, one date before it, and any disabled date or rule.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.