misaf/vendra-jalali
Composer 安装命令:
composer require misaf/vendra-jalali
包简介
Add Jalali datetime to your filament tables
关键字:
README 文档
README
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 TextColumns!
No new form components, just keep using your beautiful DatePickers and DateTimePickers!
Installation
You can install the package via composer:
composer require mokhosh/filament-jalali
PHPStan / Larastan
This package ships a PHPStan extension file (extension.neon) and macro stubs for:
Filament\Tables\Columns\TextColumnFilament\Infolists\Components\TextEntryFilament\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
To add Jalali date and date-time columns to your tables, just add jalaliDate and jalaliDateTime to the filament TextColumns 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 TextEntrys 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
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 jalalito 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
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
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 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
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
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
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
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
Run:
npm run build
or for development:
npm run dev
Credits
License
The MIT License (MIT). Please see License File for more information.
misaf/vendra-jalali 适用场景与选型建议
misaf/vendra-jalali 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「misaf」 「vendra-jalali」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 misaf/vendra-jalali 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 misaf/vendra-jalali 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 misaf/vendra-jalali 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Shared support classes for Vendra modules
Request locale resolution for Laravel applications.
Frequently Asked Questions management system with categorization
API services for the vendra-attribute module
Countries, states, provinces, and cities support for Vendra
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 44
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-09
