github malzariey/filament-daterangepicker-filter 5.0.0
v5.0.0

latest release: 5.0.1
7 hours ago

๐Ÿš€ 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/dom for 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\FilamentTimezone for system timezone

๐Ÿ“‹ Migration Guide

1. Update Dependencies

composer require malzariey/filament-daterangepicker-filter:^5.0

2. 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:


Full Changelog: 4.0.9...5.0.0

Don't miss a new filament-daterangepicker-filter release

NewReleases is sending notifications on new releases.