shahriyar3/filament-calendar

Jalali and Gregorian calendar date picker for Filament

Maintainers

Package info

github.com/shahriyar3/filament-calendar

pkg:composer/shahriyar3/filament-calendar

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.3 2026-08-02 15:34 UTC

This package is auto-updated.

Last update: 2026-08-02 15:35:40 UTC


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
Email 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