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

v1.0.9 2025-12-15 19:45 UTC

This package is auto-updated.

Last update: 2025-12-15 19:45:28 UTC


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 selection
  • minSelections(int) - Minimum selections required (when multiple)
  • maxSelections(int) - Maximum selections allowed (when multiple)
  • disabledOptions(array) - Disable specific options
  • locale(string) - Set component locale
  • format(string) - Storage format
  • displayFormat(string) - Display format
  • inline(bool) - Show inline instead of dropdown
  • gridColumns(int) - Number of grid columns
  • readOnly() - Make component read-only
  • disabled() - 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