定制 geekstek/filament-temporal-picker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

geekstek/filament-temporal-picker

最新稳定版本:v1.0.9

Composer 安装命令:

composer require 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.

README 文档

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

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-13