PHPackages                             misaf/vendra-jalali - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. misaf/vendra-jalali

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

misaf/vendra-jalali
===================

Add Jalali datetime to your filament tables

06↓100%JavaScriptCI failing

Since May 13Pushed 3w agoCompare

[ Source](https://github.com/misaf/vendra-jalali)[ Packagist](https://packagist.org/packages/misaf/vendra-jalali)[ RSS](/packages/misaf-vendra-jalali/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Add "Jalali calendar" columns and pickers to Filament
=====================================================

[](#add-jalali-calendar-columns-and-pickers-to-filament)

[![Latest Version on Packagist](https://camo.githubusercontent.com/217ba690aabc66042ffb1c0573b1d5b1a09763b9588670f987fc431ac468fd0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6b686f73682f66696c616d656e742d6a616c616c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mokhosh/filament-jalali)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3b8aab2946fdebf53357bd7d80beb3e654c838127757769532778ee13e4c271d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f6b686f73682f66696c616d656e742d6a616c616c692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mokhosh/filament-jalali/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ec8f21e1be33d882d898c0d1bc48638aee8d27e644656c30d3cd52537921ab31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6b686f73682f66696c616d656e742d6a616c616c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mokhosh/filament-jalali)

[![Jalali datetime picker form component and table text column](https://raw.githubusercontent.com/mokhosh/filament-jalali/main/art/readme.jpg)](https://raw.githubusercontent.com/mokhosh/filament-jalali/main/art/readme.jpg)

No fuss package to add Jalali Date and DateTime columns to your table, and a beautiful Jalali Date and DateTime picker to your forms. No new column type, just keep using your good old `TextColumn`s! No new form components, just keep using your beautiful `DatePicker`s and `DateTimePicker`s!

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mokhosh/filament-jalali
```

PHPStan / Larastan
------------------

[](#phpstan--larastan)

This package ships a PHPStan extension file (`extension.neon`) and macro stubs for:

- `Filament\Tables\Columns\TextColumn`
- `Filament\Infolists\Components\TextEntry`
- `Filament\Forms\Components\DateTimePicker`

If you use `phpstan/extension-installer`, it is discovered automatically.

If you do not use extension-installer, add this include to your `phpstan.neon`:

```
includes:
    - vendor/mokhosh/filament-jalali/extension.neon
```

Usage
-----

[](#usage)

To add Jalali date and date-time columns to your tables, just add `jalaliDate` and `jalaliDateTime` to the filament `TextColumn`s instead of `date` or `dateTime`.

```
// Yes! Just use Filament's original TextColumns!
use Filament\Tables;

Tables\Columns\TextColumn::make('created_at')
    ->jalaliDate(),
Tables\Columns\TextColumn::make('updated_at')
    ->jalaliDateTime(),
```

To add Jalali date and date-time columns to your infolists, just add `jalaliDate` and `jalaliDateTime` to the filament `TextEntry`s instead of `date` or `dateTime`.

```
use Filament\Infolists\Components;

Components\TextEntry::make('created_at')
    ->jalaliDate(),
Components\TextEntry::make('updated_at')
    ->jalaliDateTime(),
```

### Force Latin or Farsi Numbers

[](#force-latin-or-farsi-numbers)

By default, numbers follow the app locale. You can override this using the `latinNumbers` argument:

```
use Filament\Tables;
use Filament\Infolists\Components;

Tables\Columns\TextColumn::make('created_at')
    ->jalaliDate('Y-m-d', latinNumbers: true), // 1369-06-21

Tables\Columns\TextColumn::make('updated_at')
    ->jalaliDateTime('Y-m-d H:i:s', latinNumbers: false), // ۱۳۶۹-۰۶-۲۱ ۱۳:۱۴:۱۵

Components\TextEntry::make('created_at')
    ->jalaliDate('Y-m-d', latinNumbers: true),

Components\TextEntry::make('updated_at')
    ->jalaliDateTime('Y-m-d H:i:s', latinNumbers: false),
```

To add Jalali date and date-time pickers to your forms, just add `jalali`to your `DatePicker` and `DateTimePicker`.

```
// Yes! Just use Filament's original DatePickers and DateTimePickers!
use Filament\Forms;

Forms\Components\DatePicker::make('moderated_at')
    ->jalali(),
Forms\Components\DateTimePicker::make('published_at')
    ->jalali(),
```

Ignoring Jalali Conversion
--------------------------

[](#ignoring-jalali-conversion)

If you want to ignore jalali conversion you can use the `when` and `unless` methods:

```
use Filament\Tables;
use Filament\Infolists\Components;
use Filament\Forms;
use Illuminate\Support\Facades\App;

Tables\Columns\TextColumn::make('created_at')
    ->date()
    ->when(App::isLocale('fa'), fn (TextColumn $column) => $column->jalaliDate()),

Components\TextEntry::make('updated_at')
    ->dateTime()
    ->unless(App::isLocale('en'), fn (TextColumn $column) => $column->jalaliDateTime()),

Forms\Components\DatePicker::make('birthday')
    ->when(App::isLocale('fa'), fn (TextColumn $column) => $column->jalali()),
```

Configuring the Format Globally
-------------------------------

[](#configuring-the-format-globally)

You can set the default date formats for tables, infolists and date/time pickers anywhere you want, likely in a service provider:

```
public function boot(): void
{
    Table::$defaultDateDisplayFormat = 'Y/m/d';
    Table::$defaultDateTimeDisplayFormat = 'Y/m/d H:i:s';

    Infolist::$defaultDateDisplayFormat = 'Y/m/d';
    Infolist::$defaultDateTimeDisplayFormat = 'Y/m/d H:i:s';

    DateTimePicker::$defaultDateDisplayFormat = 'Y/m/d';
    DateTimePicker::$defaultDateTimeDisplayFormat = 'Y/m/d H:i';
    DateTimePicker::$defaultDateTimeWithSecondsDisplayFormat = 'Y/m/d H:i:s';
}
```

Some common formats you might want to use:

`j F Y` ۱۵ مهر ۱۳۶۸

`Y/m/d` ۱۳۶۸/۰۷/۱۵

`l j F` شنبه ۱۵ مهر

Filament 4 Custom Theme Integration
-----------------------------------

[](#filament-4-custom-theme-integration)

Filament 4 uses a new theme system. To include filament-jalali’s styles in your Filament admin panel, do the following:

### 1. Create a custom Filament theme

[](#1-create-a-custom-filament-theme)

Run the artisan command:

```
php artisan make:filament-theme
```

Follow the instructions to create your custom theme (e.g., `FilamentTheme`).

---

### 2. Import filament-jalali styles in your theme’s CSS file

[](#2-import-filament-jalali-styles-in-your-themes-css-file)

Add this line to your generated theme CSS file (usually something like `resources/css/filament/admin/theme.css`):

```
@source '../../../../vendor/mokhosh/filament-jalali/resources/**/*';
```

This imports all CSS/SCSS from the filament-jalali package.

---

### 3. Add the theme CSS file to your Vite input in vite.config.js

[](#3-add-the-theme-css-file-to-your-vite-input-in-viteconfigjs)

Edit your `vite.config.js`:

```
export default defineConfig({
    // ...
    build: {
        rollupOptions: {
            input: [
                // other inputs ...
                'resources/css/filament/admin/theme.css',
            ],
        },
    },
    // ...
});
```

---

### 4. Register the compiled theme CSS file in your Filament panel provider

[](#4-register-the-compiled-theme-css-file-in-your-filament-panel-provider)

In your panel service provider (e.g., `App\Providers\FilamentServiceProvider`), add:

```
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // other panel config ...
        ->viteTheme('resources/css/filament/admin/theme.css');
}
```

---

### 5. Compile your assets with Vite

[](#5-compile-your-assets-with-vite)

Run:

```
npm run build
```

or for development:

```
npm run dev
```

Credits
-------

[](#credits)

- [Mo Khosh](https://github.com/mokhosh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance62

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/41fd7351d25e29dafa18068d0418eecf6bb47a7473aabe6bc674b4ca35e71805?d=identicon)[misaf](/maintainers/misaf)

---

Top Contributors

[![misaf](https://avatars.githubusercontent.com/u/8195685?v=4)](https://github.com/misaf "misaf (3 commits)")

### Embed Badge

![Health badge](/badges/misaf-vendra-jalali/health.svg)

```
[![Health](https://phpackages.com/badges/misaf-vendra-jalali/health.svg)](https://phpackages.com/packages/misaf-vendra-jalali)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
