{"id":35731702,"url":"https://github.com/codewithkyrian/filament-date-range","last_synced_at":"2026-01-21T15:01:06.494Z","repository":{"id":296460771,"uuid":"993480447","full_name":"CodeWithKyrian/filament-date-range","owner":"CodeWithKyrian","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-02T22:49:44.000Z","size":1933,"stargazers_count":33,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T22:59:19.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeWithKyrian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-30T21:40:17.000Z","updated_at":"2025-12-02T22:48:42.000Z","dependencies_parsed_at":"2025-05-31T07:45:00.193Z","dependency_job_id":"a8641252-54f9-4e2d-ab45-28ebb2a53912","html_url":"https://github.com/CodeWithKyrian/filament-date-range","commit_stats":null,"previous_names":["codewithkyrian/filament-date-range"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/CodeWithKyrian/filament-date-range","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithKyrian%2Ffilament-date-range","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithKyrian%2Ffilament-date-range/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithKyrian%2Ffilament-date-range/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithKyrian%2Ffilament-date-range/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeWithKyrian","download_url":"https://codeload.github.com/CodeWithKyrian/filament-date-range/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithKyrian%2Ffilament-date-range/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T14:50:40.221Z","status":"ssl_error","status_checked_at":"2026-01-21T14:48:59.225Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-06T11:19:39.665Z","updated_at":"2026-01-21T15:01:06.465Z","avatar_url":"https://github.com/CodeWithKyrian.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filament DateRange\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/codewithkyrian/filament-date-range.svg?style=flat-square)](https://packagist.org/packages/codewithkyrian/filament-date-range)\n[![Total Downloads](https://img.shields.io/packagist/dt/codewithkyrian/filament-date-range.svg?style=flat-square)](https://packagist.org/packages/codewithkyrian/filament-date-range)\n[![License](https://img.shields.io/packagist/l/codewithkyrian/filament-date-range.svg?style=flat-square)](https://packagist.org/packages/codewithkyrian/filament-date-range)\n\n**Filament DateRange** is a sleek and lightweight plugin, built purely ontop AlpineJs that provides a date range picker and filter for the [Filament](https://filamentphp.com/) panel.\n\nIt has a remarkably small footprint (JS ~105KB, gzipped ~26.2KB), ensuring your admin panel remains fast and responsive without sacrificing functionality or a polished look and feel.\n\n![Filament DateRange Hero Image](art/showcase-main.png)\n\n## Features\n\n*   **Intuitive Date Range Picker Form Field:** Allows users to easily select \"start\" and \"end\" dates.\n*   **Powerful Table Filter:** Seamlessly filter your table records by date ranges.\n*   **Quick Preset Ranges:** Optional sidebar with common ranges like Today, Yesterday, Last 7 Days, This Month, etc.\n*   **Single Field Mode:** Optionally render a single input that displays the full date range (e.g. for compact table filters).\n*   **Time Range Support:** Optional time selection with an all-day toggle that defaults to start/end of day.\n*   **Lightweight \u0026 Performant:** Pure AlpineJS implementation with a minimal asset footprint.\n*   **Highly Customizable:** Extensive API for tailoring appearance, behavior, date formats, locales, and more.\n*   **RTL Support:** Automatically adjusts for right-to-left languages.\n*   **Localization Ready:** Comes with translations for many common locales.\n*   **Seamless Filament Integration:** Designed to look and feel native to the Filament ecosystem.\n\n## Version Compatibility\n\n| Filament | Filament DateRange |\n| :--- | :--- |\n| 3.x | 1.x |\n| 4.x | 2.x |\n| 5.x | 2.1+ |\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require codewithkyrian/filament-date-range\n```\n\nIf you wish to customize the translations, you can publish them using:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-date-range-translations\"\n```\n\nSimilarly, you can also publish the views if you wish using:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-date-range-views\"\n```\n\n## Form Field: `DateRangePicker`\n\nThe `DateRangePicker` component provides an elegant way to select a date range within your Filament forms.\n\n![The DateRangePicker field in its default empty state, showing placeholders.](art/form-field-basic-empty.png)\n\n### Basic Usage\n\nTo use the field, simply add it to your form schema:\n\n```php\nuse CodeWithKyrian\\FilamentDateRange\\Forms\\Components\\DateRangePicker;\n\nDateRangePicker::make('event_period')\n                -\u003elabel('Event Period'),\n```\n\n![The DateRangePicker field with a date range selected, popover closed.](art/form-field-basic-selected.png)\n\nThe field internally manages its state as an array with `start` and `end` keys, for example: `['start' =\u003e '2024-01-15', 'end' =\u003e '2024-01-20']`. How this state is persisted depends on your model and database structure.\n\n#### Storing as a Single JSON Attribute\n\nIf you intend to store the date range in a single database column (e.g., a `json` column named `event_period`), ensure your Eloquent model casts this attribute to an `array` or `json`:\n\n```php\nprotected $casts = [\n    'event_period' =\u003e 'json',\n];\n```\n\n#### Storing in Separate Date Columns\n\nIf you prefer to store the start and end dates in separate database columns (e.g., `starts_at` and `ends_at`), the recommended approach is to define an Eloquent Accessor \u0026 Mutator on your model for a virtual attribute.\n\n```php\nuse Illuminate\\Database\\Eloquent\\Casts\\Attribute;\nuse Illuminate\\Support\\Carbon;\n\nprotected function eventPeriod(): Attribute\n{\n    return Attribute::make(\n        get: fn ($value, array $attributes) =\u003e [\n            'start' =\u003e $attributes['starts_at'] ?? null,\n            'end'   =\u003e $attributes['ends_at'] ?? null,\n        ],\n        set: fn (?array $value) =\u003e [\n            'starts_at' =\u003e $value['start'] ? Carbon::parse($value['start']) : null,\n            'ends_at'   =\u003e $value['end'] ? Carbon::parse($value['end']) : null,\n        ],\n    );\n}\n\n// To ensure the `event_period` virtual attribute is correctly handled during mass assignment operations (e.g., `Model::create([])` or `Model::update([])`),\n// add its name to the `$fillable` array. This allows the `set` accessor to process the incoming date range.\nprotected $fillable = [\n    // other fillables\n    'event_period'\n];\n\n\n// To ensure your `event_period` attribute is available when Filament populates\n// the form for an existing record, you may need to add it to the `$appends` array on your model:\nprotected $appends = [\n    'event_period',\n];\n```\n\n```php\nuse CodeWithKyrian\\FilamentDateRange\\Forms\\Components\\DateRangePicker;\n\nDateRangePicker::make('event_period')\n    -\u003elabel('Event Period')\n```\n\n### Customization Options\n\n#### `displayFormat(string | Closure | null $format)`\n\nSets the display format for dates in the input fields. Accepts a **PHP date format** string. Defaults to `M j, Y` (e.g., \"Jan 15, 2024\"). See [PHP date formats](https://www.php.net/manual/en/function.date.php).\n```php\nDateRangePicker::make('booking_dates')\n    -\u003edisplayFormat('d/m/Y') // Displays as \"15/01/2024\"\n```\n![Input fields showing dates like \"15/01/2024\".](art/form-field-displayformat.png)\n\n#### `format(string | Closure $format)`\n\nSets the underlying storage format for dates (used for component state and database interaction). Accepts a **PHP date format** string. Defaults to `Y-m-d` (e.g., \"2024-01-15\"). See [PHP date formats](https://www.php.net/manual/en/function.date.php).\n```php\nDateRangePicker::make('log_period')\n    -\u003eformat('Y-m-d H:i:s') // Stores as \"2024-01-15 10:30:00\"\n```\n\n#### `defaultFormat(string | Closure $format)`\n\nSets the default storage format for all instances of the `DateRangePicker`. This is useful if you want to set a global format for your application.\n\n```php\nuse CodeWithKyrian\\FilamentDateRange\\Forms\\Components\\DateRangePicker;\n\nDateRangePicker::configureUsing(function (DateRangePicker $picker) {\n    $picker-\u003edefaultFormat('Y-m-d H:i:s');\n});\n```\n\n#### `defaultDisplayFormat(string | Closure $format)`\n\nSets the default display format for all instances of the `DateRangePicker`.\n\n```php\nuse CodeWithKyrian\\FilamentDateRange\\Forms\\Components\\DateRangePicker;\n\nDateRangePicker::configureUsing(function (DateRangePicker $picker) {\n    $picker-\u003edefaultDisplayFormat('d/m/Y');\n});\n```\n\n#### `minDate(CarbonInterface | string | Closure | null $date)`\n\nSets the earliest selectable date. Dates before this will be disabled in the calendar.\n```php\nDateRangePicker::make('future_event')\n    -\u003eminDate(now()-\u003eaddDay())\n```\n![Calendar popover showing past dates and today disabled.](art/form-field-mindate.png)\n\n#### `maxDate(CarbonInterface | string | Closure | null $date)`\n\nSets the latest selectable date. Dates after this will be disabled.\n```php\nDateRangePicker::make('past_event')\n    -\u003emaxDate(now()-\u003esubDay())\n```\n![Calendar popover showing future dates and today disabled.](art/form-field-maxdate.png)\n\n#### `enabledDates(array | Closure | null $dates)`\n\nSets specific enabled dates. When provided, only the dates in this array will be selectable; all other dates will be disabled. Accepts an array of dates (as Carbon instances or strings) or a closure that returns such an array.\n```php\nDateRangePicker::make('available_dates')\n    -\u003eenabledDates([\n        '2024-01-15',\n        '2024-01-16', \n        '2024-01-20',\n        now()-\u003eaddDays(5),\n    ])\n```\n\n![Date range picker with specific enabled dates showing only selectable dates highlighted](art/form-field-enabled-dates.png)\n\n#### `locale(string | Closure | null $locale)`\n\nSets the locale for the calendar (month names, day names) and potentially for parsing/displaying dates if the format string is locale-aware. Defaults to your application's current locale.\n```php\nDateRangePicker::make('période')\n    -\u003elocale('fr')\n```\n![Calendar popover showing month/day names in French.](art/form-field-locale-fr.png)\n\n#### `timezone(string | Closure | null $timezone)`\n\nSpecifies the timezone to be used for interpreting and processing dates. Defaults to your application's timezone (`config('app.timezone')`).\n```php\nDateRangePicker::make('appointment_time')\n    -\u003etimezone('America/New_York')\n```\n\n#### `firstDayOfWeek(int | Closure $day)`\n\nSets the first day of the week in the calendar view. `0` for Sunday (default), `1` for Monday, ..., `6` for Saturday.\n```php\nDateRangePicker::make('work_schedule')\n    -\u003efirstDayOfWeek(1) // Week starts on Monday\n```\n![Calendar popover with Monday as the first column.](art/form-field-firstday-monday.png)\n\n#### `weekStartsOnMonday()`\n\nConvenience method to set the first day of the week to Monday.\n\n```php\nDateRangePicker::make('work_schedule')\n    -\u003eweekStartsOnMonday()\n```\n\n#### `weekStartsOnSunday()`\n\nConvenience method to set the first day of the week to Sunday.\n\n```php\nDateRangePicker::make('work_schedule')\n    -\u003eweekStartsOnSunday()\n```\n\n#### `withTime(bool | Closure $condition = true)`\n\nEnables time selection alongside the date range. When enabled, the picker defaults to **start of day** for the start date and **end of day** for the end date.\n\n```php\nDateRangePicker::make('maintenance_window')\n    -\u003ewithTime()\n    -\u003ehelperText('Defaults to all-day; toggle off to pick specific times.');\n```\n\n![Time-enabled date range picker with time inputs.](art/form-field-time-range.png)\n\n#### `allDay(bool | Closure $enabled = true, bool | Closure $infer = true)`\n\nEnables all-day functionality when time selection is enabled. When `$enabled` is `true`, the all-day toggle is shown. When `$infer` is `true`, the component infers the all-day state from values (including defaults), turning the toggle on when the start time is at the start of day and the end time is at the end of day.\n\n```php\nDateRangePicker::make('maintenance_window')\n    -\u003ewithTime()\n    -\u003eallDay(true, true);\n```\n\n![Time-enabled date range picker showing the all-day toggle.](art/form-field-time-range-toggle.png)\n\n#### `startPlaceholder(string | Closure | null $placeholder)`\n\nSets the placeholder text for the \"Start\" date input field. Defaults to a localized \"Start Date\".\n```php\nDateRangePicker::make('travel_itenery')\n    -\u003estartPlaceholder('Departure Date')\n```\n\n#### `endPlaceholder(string | Closure | null $placeholder)`\n\nSets the placeholder text for the \"End\" date input field. Defaults to a localized \"End Date\".\n```php\nDateRangePicker::make('travel_itenery')\n    -\u003eendPlaceholder('Return Date')\n```\n![Inputs showing \"Departure Date\" and \"Return Date\".](art/form-field-placeholders.png)\n\n#### `separator(string | Htmlable | array | Closure $separator)`\n\nCustomizes the content displayed between the \"Start\" and \"End\" input fields. Defaults to \"to\".\n\nYou can pass:\n- a `string` / `Htmlable` for a single separator across all layouts, or\n- an `array` with `stacked` and `inline` keys to render different separators depending on layout.\n```php\nDateRangePicker::make('duration')\n    -\u003eseparator('through')\n\nDateRangePicker::make('duration')\n    -\u003estacked(['default' =\u003e true, 'lg' =\u003e false])\n    -\u003eseparator([\n        'stacked' =\u003e '↓',\n        'inline' =\u003e '→',\n    ])\n```\n\n#### `separatorIcon(string | array | Closure | null $icon)`\n\nA convenience method to use Filament icons as separators.\n\nYou can pass a single icon, or an array with `stacked` and `inline` icons.\n```php\nDateRangePicker::make('project_duration')\n    -\u003eseparatorIcon('heroicon-o-arrow-long-right')\n\nDateRangePicker::make('project_duration')\n    -\u003estacked(['default' =\u003e true, 'lg' =\u003e false])\n    -\u003eseparatorIcon([\n        'stacked' =\u003e 'heroicon-o-arrow-down',\n        'inline' =\u003e 'heroicon-o-arrow-long-right',\n    ])\n```\n![An arrow icon shown between the \"Start\" and \"End\" inputs.](art/form-field-separator-icon.png)\n\n#### `autoApply(bool | Closure $condition = true)`\n\nIf `true` (default), the selection is applied immediately as dates are picked. The panel closes automatically after a valid range is set, **except when `withTime()` is enabled**—in that case the panel stays open so times can be adjusted.  \nIf `false`, \"Apply\" and \"Cancel\" buttons are shown, and changes are only committed when you click Apply.\n```php\nDateRangePicker::make('conference_dates')\n    -\u003eautoApply(true)\n```\n![Calendar popover with \"Apply\" and \"Cancel\" buttons visible.](art/form-field-no-autoclose.png)\n\n#### `presets(bool | array| Closure $condition = true)`\n\nEnables a presets sidebar in the calendar popover with common ranges such as **Last 7 Days**, **Last 2 Weeks**, **Last 30 Days**, **This Month**, **Last Month**, **This Year**, and **Last Year**.  \nYou can pass:\n- `true` (default when calling `-\u003epresets()` with no arguments) to use the built-in list.\n- `false` to disable presets.\n- an `array` (or `Closure` that returns an array) of preset definitions to customize which presets are shown.\n\n```php\nDateRangePicker::make('order_period')\n    -\u003elabel('Order Period')\n    -\u003epresets(); // use built-in presets\n\nDateRangePicker::make('order_period_custom')\n    -\u003elabel('Order Period')\n    -\u003epresets([\n        // Just keys (uses built-in labels)\n        'last_7_days',\n        'last_14_days',\n\n        // Or explicit key + custom label\n        ['key' =\u003e 'this_month', 'label' =\u003e 'Current Month'],\n    ]);\n```\n\n![Date range picker showing a presets sidebar with common ranges like Last 7 Days and Last 2 Weeks.](art/form-field-presets.png)\n\n#### `dualCalendar(bool | Closure $condition = true)`\n\nDetermines if two calendars (for consecutive months) should be displayed side-by-side in the popover. Defaults to `true` (dual calendars). Set to `false` to display a single calendar.\n```php\nDateRangePicker::make('date_range')\n    -\u003edualCalendar(false) // Show only a single month calendar\n```\n![Calendar popover showing only one month.](art/form-field-single-calendar.png)\n\n#### `inline(bool | array | Closure $condition = true)`\n\nControls whether the start and end inputs are displayed inline (horizontally) or stacked (vertically). Defaults to `true` (inline layout).\n\nFor responsive behavior, pass a breakpoint map using Tailwind's breakpoints (`default`, `sm`, `md`, `lg`, `xl`, `2xl`).\n```php\nDateRangePicker::make('event_period')\n    -\u003einline() // Display inputs side by side (default)\n\nDateRangePicker::make('event_period')\n    -\u003einline(['default' =\u003e false, 'lg' =\u003e true]) // Stacked on mobile, inline from lg\n```\nWhen a breakpoint is not specified, the default is used for that breakpoint.\n![Date range picker with inputs displayed horizontally side by side.](art/form-field-inline.png)\n\n#### `stacked(bool | array | Closure $condition = true)`\n\nA convenience method to set the layout to stacked (vertical). Equivalent to `-\u003einline(false)`.\n\nYou can also pass a breakpoint map for responsive layouts.\n```php\nDateRangePicker::make('event_period')\n    -\u003estacked() // Display inputs vertically stacked\n\nDateRangePicker::make('event_period')\n    -\u003estacked(['default' =\u003e true, 'lg' =\u003e false]) // Stacked on mobile, inline from lg\n```\n![Date range picker with inputs displayed vertically stacked.](art/form-field-stacked.png)\n\n#### `singleField(bool | Closure $condition = true)`\n\nRenders a single input that displays the entire date range (for example: `Jan 3, 2026 — Jan 8, 2026`) instead of separate start and end inputs. This works especially well for compact layouts.\n\n```php\nDateRangePicker::make('invoice_period')\n    -\u003elabel('Invoice Period')\n    -\u003esingleField();\n```\n\n![Single input field displaying the full selected date range.](art/form-field-single-field.png)\n\n#### `readOnly(bool | Closure $condition = true)`\n\nMakes the input fields read-only, preventing direct text input (selection via calendar is still possible).\n\n#### `disabled(bool | Closure $condition = true)`\n\nDisables the entire component, preventing any interaction.\n\n#### `required(bool | Closure $condition = true)`\n\nWhen required, both the start and end dates must be filled. If only one side is selected, validation will fail for the missing side.\n\n#### Affixes (Prefixes \u0026 Suffixes)\n\nYou can add icons, labels, or actions as prefixes or suffixes to both the \"Start\" and \"End\" input fields individually, similar to how the inbuilt Filament fields work.\n\nAvailable methods (replace `start` with `end` for the \"End\" input):\n-   `startPrefix(string | Htmlable | Closure | null $label, bool | Closure $isInline = false)`\n-   `startPrefixIconColor(string | array | Closure | null $color = null)`\n-   `startPrefixIcon(string | Closure | null $icon, bool | Closure $isInline = false)`\n-   `startPrefixAction(Action | Closure $action, bool | Closure $isInline = false)`\n-   `startPrefixActions(array $actions, bool | Closure $isInline = false)`\n-   `startSuffix(string | Htmlable | Closure | null $label, bool | Closure $isInline = true)`\n-   `startSuffixIcon(string | Closure | null $icon, bool | Closure $isInline = true)`\n-   `startSuffixIconColor(string | array | Closure | null $color = null)`\n-   `startSuffixAction(Action | Closure $action, bool | Closure $isInline = true)`\n-   `startSuffixActions(array $actions, bool | Closure $isInline = true)`\n-   `inlineStartPrefix(bool | Closure $isInline = true)`\n-   `inlineStartSuffix(bool | Closure $isInline = true)`\n\nExample:\n```php\nuse Filament\\Forms\\Components\\Actions\\Action;\n\nDateRangePicker::make('licence_validity')\n    -\u003estartPrefix('Valid')\n    -\u003eendSuffixAction(\n        Action::make('info')\n            -\u003eicon('heroicon-o-information-circle')\n            -\u003etooltip('This range is inclusive.')\n            -\u003eaction(fn () =\u003e null)\n    )\n```\n\n![The \"Start\" input with \"Valid\" as a prefix label, and the \"End\" input with an info icon suffix action.](art/form-field-affixes.png)\n\n\n## Table Filter: `DateRangeFilter`\n\nThe `DateRangeFilter` allows you to easily filter records in your Filament tables based on a date column falling within a selected range.\n\n![A Filament table showing records filtered by a date range, with the filter indicator visible, e.g., \"Order Date: Jan 15, 2024 - Jan 20, 2024\".](art/table-filter-active.png)\n\n### Basic Usage\n\nAdd the `DateRangeFilter` to your table's filters array:\n\n```php\nuse CodeWithKyrian\\FilamentDateRange\\Tables\\Filters\\DateRangeFilter;\n\nDateRangeFilter::make('created_at'\n            -\u003elabel('Created within'),\n```\n\nWhen activated, this filter will display the `DateRangePicker` component, allowing users to select a \"start\" and \"end\" date.\n\n![The filter dropdown open, showing the DateRangePicker ready for input.](art/table-filter-dropdown.png)\n\n### Filter Configuration\n\nThe `DateRangeFilter` mirrors many of the customization methods available on the `DateRangePicker` form component, passing them through to the underlying picker:\n\n-   `displayFormat(string | Closure | null $format)`\n-   `format(string | Closure | null $format)` (Note: The filter state uses `Y-m-d` by default for its internal `start` and `end` values)\n-   `minDate(CarbonInterface | string | Closure | null $date)`\n-   `maxDate(CarbonInterface | string | Closure | null $date)`\n-   `enabledDates(array | Closure | null $dates)`: Sets specific enabled dates; all other dates will be disabled\n-   `timezone(string | Closure | null $timezone)`\n-   `locale(string | Closure | null $locale)`\n-   `firstDayOfWeek(int | Closure $day)`\n-   `startPlaceholder(string | Closure | null $placeholder)`\n-   `endPlaceholder(string | Closure | null $placeholder)`\n-   `autoApply(bool | Closure $condition = true)`: For filters, defaulting to `true` often provides a smoother UX, as the filter applies once the range is set and the popover closes (unless time is enabled).\n-   `dualCalendar(bool | Closure $condition = true)`\n-   `inline(bool | Closure $condition = true)`: Controls whether the start and end inputs are displayed horizontally (default) or vertically\n-   `stacked(bool | Closure $condition = true)`: Convenience method to set vertical layout, equivalent to `-\u003einline(false)`\n-   `withTime(bool | Closure $condition = true)`: Enable time selection in the filter\n-   `allDay(bool | Closure $enabled = true, bool | Closure $infer = true)`: Show all-day toggle and infer all-day state\n-   `showAllDayToggle(bool | Closure $condition = true)`: Show/hide the all-day toggle when time is enabled\n-   `defaultAllDay(bool | Closure $condition = true)`: Default the all-day toggle to on/off\n\nExample:\n```php\nDateRangeFilter::make('processed_at')\n    -\u003elabel('Processing Date')\n    -\u003edisplayFormat('d M Y')\n    -\u003eminDate(now()-\u003esubYear())\n```\n\n### Query Application\n\nThe filter, by default, applies a `WHERE column \u003e= start_date AND column \u003c= end_date` condition to your Eloquent query. When time selection is disabled, the `start_date` is taken as the start of the selected day and `end_date` as the end of the selected day. When time selection is enabled, the exact timestamps selected in the picker are used, respecting the configured timezone.\n\n#### `modifyQueryUsing(Closure $callback)`\n\nFor more complex filtering logic, you can provide a custom query modification callback.\n```php\nDateRangeFilter::make('event_span')\n    -\u003elabel('Event Overlaps With')\n    -\u003emodifyQueryUsing(function (Builder $query, array $data, $state) {\n        $start = $state['start'] ? Carbon::parse($state['start'])-\u003estartOfDay() : null;\n        $end = $state['end'] ? Carbon::parse($state['end'])-\u003eendOfDay() : null;\n\n        if ($start \u0026\u0026 $end) {\n            return $query-\u003ewhere(function (Builder $query) use ($start, $end) {\n                $query-\u003ewhere('event_starts_at', '\u003c=', $start)\n                        -\u003ewhere('event_ends_at', '\u003e=', $end);\n            });\n        }\n        return $query;\n    })\n```\n\n### Filter Indicator\n\nThe filter automatically provides an indicator when active, displaying the selected range. Example: \"Created within: Jan 15, 2024 - Jan 20, 2024\".\nThe date format used in the indicator matches the `displayFormat` of the picker.\n\n## Localization\n\nThis package is translation-ready. It includes translations for placeholders and button labels within the picker. The following locales are currently supported:\n\nar, bs, ca, ckb, cs, cy, da, de, en, es, et, fa, fi, fr, hi, hu, hy, id, it, ja, ka, km, ko, ku, lt, lv, ms, my, nl, no, pl, pt_BR, pt_PT, ro, ru, sk, sl, sv, th, tr, uk, uz, vi, zh_CN, zh_TW.\n\nTo publish the translation files to your `lang/vendor/filament-date-range` directory for customization:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-date-range-translations\"\n```\n\nThe component will use the application's current locale by default.\n\n## Custom Styling\n\nThe component uses a minimal set of custom CSS classes for specific structural elements (like date cell rounding for LTR/RTL) that might not be covered by Filament's default Tailwind build. These styles are automatically registered.\n\nAll color-related styling (primary colors, text, backgrounds) is designed to inherit directly from your active Filament theme, ensuring visual consistency.\n\nIf you need to deeply customize the HTML structure, you can publish the main view:\n\n```bash\nphp artisan vendor:publish --tag=\"filament-date-range-views\"\n```\n\nThis will publish `date-range-picker.blade.php` to `resources/views/vendor/filament-date-range/forms/components/`. **Caution:** Modifying this directly can make updating the package more complex.\n\n## Contributing\n\nFound a bug or have a feature request? Please open an issue. Pull requests are also welcome!\n\nThank you for using Filament DateRange! I hope it enhances your Filament applications. Consider starring the repository on GitHub if you find it useful!\n\n## License\n\nFilament DateRange is open-sourced software licensed under the [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithkyrian%2Ffilament-date-range","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithkyrian%2Ffilament-date-range","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithkyrian%2Ffilament-date-range/lists"}