Overview
TheDateFilter class provides a single date picker input for filtering by a specific date. It uses the native HTML5 date input and applies a whereDate query.
Creating a DateFilter
Available Methods
label
minDate
maxDate
key
default
Sets a default date value for the filter.
The default date value (string in ‘Y-m-d’ format)
initialValue
Sets an initial date value that is pre-applied when the table first loads.
The initial date value (string in ‘Y-m-d’ format)
filter
Provides a custom query callback to override the default filter behavior.
A closure that receives
Builder $query and mixed $value (date string) and returns the modified BuildergroupClass / labelClass / inputClass
Sets CSS classes for the filter wrapper, label, or input element.
Value Format
Date values are expected inY-m-d format:
Value Clamping
Date values are automatically clamped to stay within minDate/maxDate bounds:2025-05-15, it will be clamped to 2024-12-31.
Default Behavior
By default,DateFilter applies a whereDate query:
Complete Examples
Basic Usage
Custom Filter Logic
Usage in Table Component
Dynamic Date Constraints
UI Rendering
The filter renders a native HTML5 date input (<input type="date">), which provides a consistent date picker across browsers. The exact appearance depends on your browser and theme (Tailwind, Bootstrap 5, or Bootstrap 4).
Related Filters
- For date ranges, use DateRangeFilter
- For multiple dates, use MultiDateFilter