This package is no longer maintained please upgrade to ariaieboy/filament-jalali
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.
- step 1: Change the package version in your
composer.json
to^3
and run the composer update command:
"ariaieboy/filament-jalali-datetimepicker": "^3",
- step 2 : If you using the
JalaliDateTimePicker
orJalaliDatePicker
classes you should remove those and use the default Filament DatePicker class.- For more info check the step 2 of the v1 to v2 upgrade guide.
- step 3 (optional) : in V3 we introduced 2 new lang files called
months
anddays
using these 2 file you can customize the months and days labels.- To customize the lang files you can use this command:
php artisan vendor:publish --tag=filament-jalali-datetimepicker-translations
- To customize the lang files you can use this command:
- backward compatibility checks:
- in V3 we changed some default values if you want to customize these values, you should use the methods after the
jalali
method.- The default day label is
long
to change this you should passtrue
as the firstjalali(weekdaysShort: true)
argument. - We changed the default start of the week to
saturday
- the default format is changed to
Y-m-d
andY-m-d H:i:s
fordatePicker
anddateTimePicker
- The default day label is
- We changed the underlying package that provide jalali compatibility for dayjs to
@calidy/dayjs-calendarsystems
- In V3 we only support
laravel >= 11
andphp >= 8.2
- in V3 we changed some default values if you want to customize these values, you should use the methods after the
- step 1:Change the package version in your
composer.json
to^2
and run the composer update command:
"ariaieboy/filament-jalali-datetimepicker": "^2",
-
step 2 (optional):
You can change
jalaliDatePicker
andjalaliDateTimePicker
to the defaultDatePicker
andDateTimePicker
and then usejalali()
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.