geekstek / filament-temporal-picker
A Filament 4 plugin providing flexible temporal selection components including year, month, week, weekday, and day-of-month pickers with multi-select and range support.
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/geekstek/filament-temporal-picker
Requires
- php: ^8.3
- filament/filament: ^4.0
- illuminate/contracts: ^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-livewire: ^3.0
README
A Filament 4 plugin providing flexible temporal selection components including year, month, week, weekday, and day-of-month pickers with multi-select and range support.
Installation
composer require geekstek/filament-temporal-picker
Components
MonthPicker
Select a month with year navigation.
use Geekstek\TemporalPicker\Forms\Components\MonthPicker; MonthPicker::make('billing_month') ->label('Billing Month') ->required() ->minDate('2024-01') ->maxDate('2025-12') ->showYear()
Multiple Selection:
MonthPicker::make('selected_months') ->label('Select Months') ->multiple() ->minSelections(1) ->maxSelections(6)
YearPicker
Select a year from a range.
use Geekstek\TemporalPicker\Forms\Components\YearPicker; YearPicker::make('fiscal_year') ->label('Fiscal Year') ->range(2020, 2030)
Inline Grid Mode:
YearPicker::make('year') ->label('Year') ->inline() ->gridColumns(4) ->range(2020, 2025)
WeekPicker
Select a week using a calendar interface.
use Geekstek\TemporalPicker\Forms\Components\WeekPicker; WeekPicker::make('work_week') ->label('Work Week') ->yearRange(2024, 2025) ->showWeekNumber() ->weekStartsOnMonday()
WeekdayPicker
Select one or multiple days of the week.
use Geekstek\TemporalPicker\Forms\Components\WeekdayPicker; WeekdayPicker::make('working_days') ->label('Working Days') ->multiple() ->shortLabels() ->disabledOptions(['saturday', 'sunday'])
Integer Values:
WeekdayPicker::make('working_days') ->asInteger() // Returns 1-7 instead of 'monday'-'sunday'
DayOfMonthPicker
Select one or multiple days of the month (1-31).
use Geekstek\TemporalPicker\Forms\Components\DayOfMonthPicker; DayOfMonthPicker::make('billing_days') ->label('Billing Days') ->multiple() ->dayRange(1, 28) ->disabledOptions([29, 30, 31])
Dropdown Mode:
DayOfMonthPicker::make('day') ->showCalendarGrid(false) // Use dropdown instead of grid
Common Options
All temporal pickers support:
multiple(bool)- Enable multiple selectionminSelections(int)- Minimum selections required (when multiple)maxSelections(int)- Maximum selections allowed (when multiple)disabledOptions(array)- Disable specific optionslocale(string)- Set component localeformat(string)- Storage formatdisplayFormat(string)- Display formatinline(bool)- Show inline instead of dropdowngridColumns(int)- Number of grid columnsreadOnly()- Make component read-onlydisabled()- Disable the component
Configuration
Publish the config file:
php artisan vendor:publish --tag=temporal-picker-config
// config/temporal-picker.php return [ 'locale' => null, // Defaults to app locale 'first_day_of_week' => 1, // 0 = Sunday, 1 = Monday 'weekday_format' => 'string', // 'string' or 'integer' 'year_range' => [ 'min' => 1900, 'max' => 2100, ], 'formats' => [ 'year' => 'Y', 'month' => 'Y-m', 'week' => 'Y-\WW', 'date' => 'Y-m-d', ], ];
Translations
Publish translations:
php artisan vendor:publish --tag=temporal-picker-translations
Available locales: en, zh_CN
License
MIT License