๐ v5.0 โ Complete Rewrite: Alpine.js + Day.js
A ground-up rewrite replacing jQuery & Moment.js with a native Alpine.js component powered by Day.js.
This is a major release with breaking changes. The entire frontend has been rebuilt from scratch for better performance, smaller bundle size, and seamless Filament v4/v5 integration.
โจ What's New
Architecture
- Alpine.js Native โ No more jQuery dependency. The picker is a first-class Alpine.js component with full Livewire reactivity.
- Day.js โ Replaced Moment.js (330KB) with Day.js (7KB) for date manipulation. ~97% smaller.
- Floating UI โ Replaced manual positioning with
@floating-ui/domfor robust dropdown placement that handles scroll, resize, and viewport edges automatically. - IMask.js โ Integrated input masking for precise manual date entry with auto-padding and block navigation.
New Features
- ๐๏ธ Month Picker โ
->monthPicker()for selecting month ranges - ๐
Year Picker โ
->yearPicker()for selecting year ranges - โจ๏ธ Manual Input โ
->allowInput()enables typed date entry with format-aware masking - ๐ฏ Teleport โ
->teleport()(enabled by default) moves the dropdown to<body>, solving z-index issues in modals and slide-overs - โฟ Keyboard Navigation โ Full arrow key, Home/End, PageUp/PageDown, Enter/Escape support
- ๐ Dual State Fields โ
->dualState('start_field', 'end_field')syncs to two separate Livewire properties - ๐ PHP Format Tokens โ
->format('Y-m-d')uses PHP Carbon tokens. The package auto-converts to Day.js tokens for the frontend. - ๐ 32 Bundled Locales โ All locales are statically imported and work without async loading:
ar,cs,da,de,el,es,fa,fr,he,hu,id,it,ko,ku,lt,lv,nb,nl,pl,pt,pt-br,ro,ru,sk,sl,tr,uk,uz,vi,zh-cn,zh-tw
Performance & Quality
- โก Synchronous Init โ No more
async init(). Locales are bundled, eliminating runtime import latency. - ๐งน Static Format Map โ PHPโDay.js format conversion uses a static class constant instead of rebuilding on every call.
- ๐ฏ Strict Comparisons โ All
==/!=replaced with===/!==across the codebase. - ๐งช 148 Tests โ Comprehensive Pest test suite covering fields, filters, formats, Livewire integration, and default presets.
๐ฅ Breaking Changes
Dependencies Removed
| Removed | Replaced By |
|---|---|
jquery
| Alpine.js (bundled with Filament) |
moment / moment-timezone
| dayjs ^1.11
|
daterangepicker (jQuery plugin)
| Native Alpine.js component |
API Changes
Format Method
- ->displayFormat('DD/MM/YYYY') // Day.js tokens (still works, deprecated)
+ ->format('d/m/Y') // PHP Carbon tokens (recommended)Deprecated Methods
These methods still work but will be removed in a future version:
| Deprecated | Use Instead |
|---|---|
->displayFormat('DD/MM/YYYY')
| ->format('d/m/Y')
|
->setTimePickerOption(true)
| ->timePicker()
|
->setTimePickerIncrementOption(15)
| ->timePickerIncrement(15)
|
->setTimePicker24HourOption(true)
| ->timePicker24()
|
->setTimePickerSecondOption(true)
| ->timePickerSecond()
|
->setAutoApplyOption(true)
| ->autoApply()
|
Filament Version
- Requires Filament v4.0+ or Filament v5.0+
- Uses
Filament\Support\Facades\FilamentTimezonefor system timezone
๐ Migration Guide
1. Update Dependencies
composer require malzariey/filament-daterangepicker-filter:^5.02. Remove jQuery/Moment Assets
If you were manually including jQuery or Moment.js for this package, remove them โ they're no longer needed.
3. Update Format Calls
// Before (v4)
DateRangePicker::make('range')->displayFormat('DD/MM/YYYY');
// After (v5) โ use PHP Carbon tokens
DateRangePicker::make('range')->format('d/m/Y');4. New Features (Optional)
// Month picker
DateRangePicker::make('month_range')->monthPicker();
// Year picker
DateRangePicker::make('year_range')->yearPicker();
// Manual input with masking
DateRangePicker::make('range')->allowInput();
// Dual state (sync to two separate properties)
DateRangePicker::make('range')->dualState('start_date', 'end_date');๐ฆ Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.1 |
| Laravel | ^10.0 | ^11.0 | ^12.0 | ^13.0 |
| Filament | ^4.0 | ^5.0 |
Runtime JS Dependencies (bundled)
| Package | Version | Purpose |
|---|---|---|
dayjs
| ^1.11 | Date manipulation |
@floating-ui/dom
| ^1.6 | Dropdown positioning |
imask
| ^7.6 | Input masking |
๐ Contributors
Thanks to all contributors who helped shape this release:
- @ahmed-rashad-alnaggar โ FilamentTimezone integration
- @Youssef-Amjad โ Laravel 13 support, version constraint fixes
- @andreiio โ Romanian translations
- @tiagof โ Portuguese translations
- @juliangums โ 12/24-hour format fix
Full Changelog: 4.0.9...5.0.0