shahriyar3 / filament-calendar
Jalali and Gregorian calendar date picker for Filament
Requires
- php: ^8.2
- filament/filament: ^5.0
- illuminate/support: ^11.0|^12.0|^13.0
- morilog/jalali: ^3.5
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
README
Jalali (Persian/Shamsi) and Gregorian date picker components for Filament v5.
Table of Contents
Features
- Jalali and Gregorian calendar UI (storage always Gregorian)
- Optional time selection
- Configurable colors, font, locale, RTL
- Compact (dropdown / mobile bottom sheet) and fullscreen display modes
- Per-field overrides for calendar type, time, display mode, min/max dates, disabled dates
- Table columns for formatted date display
- Legacy aliases:
JalaliDatePicker,JalaliDateTimePicker,JalaliDateColumn,JalaliDateTimeColumn
Installation
composer require shahriyar3/filament-calendar
Register the plugin in your Filament panel:
use FilamentCalendar; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentCalendar::make(), ]); }
Or without import:
->plugins([ \FilamentCalendar::make(), ])
Publish config and fonts:
php artisan vendor:publish --tag=filament-calendar-config php artisan vendor:publish --tag=filament-calendar-fonts php artisan filament:assets
Usage
use Shahriyar\FilamentCalendar\Forms\Components\CalendarDatePicker; CalendarDatePicker::make('start_date') CalendarDatePicker::make('starts_at')->withTime() CalendarDatePicker::make('birth_date')->calendarType('gregorian') CalendarDatePicker::make('event_date')->displayMode('fullscreen') CalendarDatePicker::make('makeup_date') ->minDate(today()->toDateString()) ->maxDate('2026-12-31') ->disabledDates(['2026-03-20']) ->seconds(false) ->native(false)
Table columns
use Shahriyar\FilamentCalendar\Tables\Columns\CalendarDateColumn; CalendarDateColumn::make('created_at') CalendarDateColumn::make('created_at')->calendarType('gregorian')
Configuration
See config/filament-calendar.php for all options:
| Key | Default | Description |
|---|---|---|
calendar |
jalali |
jalali or gregorian |
enable_time |
false |
Show time picker by default |
display_mode |
compact |
compact or fullscreen |
colors.primary |
#0034C6 |
Primary theme color |
font.family |
Vazirmatn, ... |
Calendar font |
rtl |
true |
RTL layout |
native |
false |
Use browser date input |
seconds |
true |
Show seconds in datetime |
Environment variables: FILAMENT_CALENDAR_TYPE, FILAMENT_CALENDAR_COLOR_PRIMARY, etc.
Demo
The demo/ directory is a standalone Filament admin app that exercises every picker variant shipped with this package. Use it to explore Jalali/Gregorian calendars, datetime fields, fullscreen mode, and date restrictions without wiring the package into your own project first.
Prerequisites
- PHP 8.2+
- Composer
- SQLite (used by default; no extra database setup required)
Setup
From the repository root:
cd demo
composer install
cp .env.example .env
php artisan key:generate
php artisan vendor:publish --tag=filament-calendar-fonts
php artisan filament:assets
php artisan migrate --seed
php artisan serve
Then open http://localhost:8000/admin and sign in with:
| Field | Value |
|---|---|
test@example.com |
|
| Password | password |
What to try
Open Calendar Demo from the sidebar. The page includes:
| Section | Fields | What it demonstrates |
|---|---|---|
| Jalali | تاریخ شمسی, تاریخ و زمان شمسی | Jalali date and datetime pickers |
| Gregorian | Gregorian date | Gregorian calendar UI |
| Advanced | Fullscreen picker, With min/max/disabled | displayMode('fullscreen'), minDate(), maxDate(), disabledDates() |
Submitted values are stored as Gregorian strings in the form state (same behavior as in a real Filament form).
Demo app structure
- Panel path:
/admin - Plugin registration:
demo/app/Providers/Filament/AdminPanelProvider.php - Demo page:
demo/app/Filament/Pages/CalendarDemoPage.php
See also demo/README.md for a quick reference.
Testing
composer test
License
MIT