a Drop-in Jalali Replacement for filament DateTimePicker
MIT License
This package adds jalali support to filament v3 DatePicker
and DateTimePicker
.
For Filament v2 you can use the version 1 of this package.
You can install the package via composer:
composer require ariaieboy/filament-jalali-datetimepicker
use Ariaieboy\FilamentJalaliDatetimepicker\Forms\Components\JalaliDatePicker;
use Ariaieboy\FilamentJalaliDatetimepicker\Forms\Components\JalaliDateTimePicker;
\Filament\Forms\Components\DatePicker::make('birth_date')->jalali();
\Filament\Forms\Components\DateTimePicker::make('birth_date')->jalali(weekdaysShort: true);
for more information check the default DateTimePicker Docs : https://filamentphp.com/docs/2.x/forms/fields#date-time-picker
Please see CHANGELOG for more information on what has changed recently.
composer.json
to ^3
and run the composer update command: "ariaieboy/filament-jalali-datetimepicker": "^3",
JalaliDateTimePicker
or JalaliDatePicker
classes you should remove those and use the default Filament DatePicker class.
months
and days
using these 2 file you can customize the months and days labels.
php artisan vendor:publish --tag=filament-jalali-datetimepicker-translations
jalali
method.
long
to change this you should pass true
as the first jalali(weekdaysShort: true)
argument.saturday
Y-m-d
and Y-m-d H:i:s
for datePicker
and dateTimePicker
@calidy/dayjs-calendarsystems
laravel >= 11
and php >= 8.2
composer.json
to ^2
and run the composer update command: "ariaieboy/filament-jalali-datetimepicker": "^2",
step 2 (optional):
You can change jalaliDatePicker
and jalaliDateTimePicker
to the default DatePicker
and DateTimePicker
and then
use jalali()
method to convert a datepicker to jalali format
For example:
//convert
JalaliDateTimePicker::make('birth_date'),
// to
Forms\Components\DateTimePicker::make('birth_date')->jalali(),
//and
//convert
JalaliDatePicker::make('birth_date'),
//to
\Filament\Forms\Components\DatePicker::make('birth_date')->jalali()
The old format will work in v2
but we might remove it in the next major versions.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.