ariaieboy / filament-jalali
Add Jalali/Shamsi support for FilamentPHP
Installs: 650
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: ~8.2.0|~8.3|~8.4
- ariaieboy/jalali: ^1.0.1
- filament/filament: ^3
- illuminate/contracts: ^10|^11
- spatie/laravel-package-tools: ^1.13.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- larastan/larastan: ^2.2
- nunomaduro/collision: ^8
- orchestra/testbench: ^9
- pestphp/pest: ^2
- pestphp/pest-plugin-laravel: ^2
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.1.1
- spatie/laravel-ray: ^1.30
README
This package adds Jalali/Shamsi support to filament v3.
We have Jalali/Shamsi support for DatePicker
,DateTimePicker
,TextColumn
, TextEntry
and DateConstraint
.
It's a replacement for ariaieboy/filament-jalali-datetime and ariaieboy/filament-jalali-datetimepicker. For Upgaring guide check here
Installation
You can install the package via composer:
composer require ariaieboy/filament-jalali
Usage
use Filament\Forms\Components\DatePicker; use Filament\Forms\Components\DateTimePicker; DatePicker::make('birth_date')->jalali(); DateTimePicker::make('birth_date')->jalali(weekdaysShort: true);
For more information check the default DateTimePicker Docs
use Filament\Tables\Columns\TextColumn; TextColumn::make('created_at')->jalaliDate(); TextColumn::make('created_at')->jalaliDateTime();
For more information check the default TextColumn Docs
use Filament\Infolists\Components\TextEntry; TextEntry::make('created_at')->jalaliDate(); TextEntry::make('created_at')->jalaliDateTime(); TextEntry::make('created_at')->since()->jalaliDateTooltip(); TextEntry::make('created_at')->since()->jalaliDateTimeTooltip();
For more information check the default TextEntry Docs
use Filament\Tables\Filters\QueryBuilder\Constraints\DateConstraint; use Ariaieboy\FilamentJalali\DateConstraint\Operators\IsJalaliAfterOperator; use Ariaieboy\FilamentJalali\DateConstraint\Operators\IsJalaliBeforeOperator; use Ariaieboy\FilamentJalali\DateConstraint\Operators\IsJalaliDateOperator; use Ariaieboy\FilamentJalali\DateConstraint\Operators\IsJalaliYearOperator; DateConstraint::make('created_at')->jalali(); //Or you can use any operations that you like DateConstraint::make('created_at')->operators([ IsJalaliAfterOperator::class, IsJalaliBeforeOperator::class, IsJalaliDateOperator::class, IsJalaliYearOperator::class ]);
For more information check the default DateConstraint Docs
We don't support
IsJalaliMonthOperator
since there is not and efficient way to query georgian month according to the jalali/shamsi month.
Fill free to open a PR that adds
IsJalaliMonthOperator
if you have an algorithm to convert jalali/shamsi month to georgian month.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Upgrading
from ariaieboy/filament-jalali-datetimepicker
If you are using the V3 of the jalali-datetimepicker you don't need to do anything just replace ariaieboy/filament-jalali-datetimepicker
with ariaieboy/filament-jalali
from ariaieboy/filament-jalali-datetime
If you use the jalaliDate()
and jalaliDateTime()
on the TextColumn
you can upgrade without any problem.
But if you use the JalaliDateTimeColumn
you need to change it to TextColumn
and convert dateTime() to jalaliDateTime()
and date() to jalaliDate()
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.