© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Mark Chaney

Custom ValidationMessages for minDate/maxDate

I have tried the following, but the html5 validation still shows the default browser error. Do i need to about it differently?
DatePicker::configureUsing(function (DatePicker $datePicker) {
    return $datePicker->minDate(Carbon::createFromDate(1500, 1, 1))
        ->maxDate(now()->addYears(9))
        ->validationMessages([
            'after_or_equal' => 'The :attribute must be after January 1, 1500.',
            'before_or_equal' => 'The :attribute cannot be more than 9 years in the future.',
        ]);
});
DatePicker::configureUsing(function (DatePicker $datePicker) {
    return $datePicker->minDate(Carbon::createFromDate(1500, 1, 1))
        ->maxDate(now()->addYears(9))
        ->validationMessages([
            'after_or_equal' => 'The :attribute must be after January 1, 1500.',
            'before_or_equal' => 'The :attribute cannot be more than 9 years in the future.',
        ]);
});
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

validationMessages not working for regex
FilamentFFilament / ❓┊help
2y ago
validationMessages not work
FilamentFFilament / ❓┊help
2y ago
DateTimePicker showing seconds with minDate
FilamentFFilament / ❓┊help
2y ago
any way to customize validationMessages for a checkbox?
FilamentFFilament / ❓┊help
2y ago